# Class PlotCaching

java.lang.Object
uk.ac.starlink.ttools.plot2.PlotCaching

public class PlotCaching extends Object
Encapsulates some choices about what caching is performed when preparing a plot.

Since:
  16 Jan 2017
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`PlotCaching()`
Constructs an instance with no caching.

## Method Summary

Modifier and Type
Method
Description
`static PlotCaching`
`createFullyCached()`
Returns an instance in which as much as possible is cached between plot frames.
`static PlotCaching`
`createUncached()`
Returns an instance in which nothing is cached between plot frames.
`boolean`
`getCacheImage()`
Returns images caching policy.
`boolean`
`getReuseRanges()`
Returns the aux range caching policy.
`boolean`
`getUsePlans()`
Returns the plan caching policy.
`void`
`setCacheImage(boolean cacheImage)`
Sets image caching policy.
`void`
`setReuseRanges(boolean reuseRanges)`
Sets aux range caching policy.
`void`
`setUsePlans(boolean usePlans)`
Sets plan caching policy.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PlotCaching

public PlotCaching()
Constructs an instance with no caching.

## Method Details

### setCacheImage

public void setCacheImage(boolean cacheImage)
Sets image caching policy. If true, plot image will be cached where applicable, if false it will be regenerated from the data on every repaint.

Parameters:
  `cacheImage` - image caching policy

### getCacheImage

public boolean getCacheImage()
Returns images caching policy. If true, plot image will be cached where applicable, if false it will be regenerated from the data on every repaint.

Returns:
  image caching policy

### setReuseRanges

public void setReuseRanges(boolean reuseRanges)
Sets aux range caching policy. If true, aux ranges will be calculated only once, if false they will be recalculated when the surface changes.

Parameters:
  `reuseRanges` - aux range caching policy

### getReuseRanges

public boolean getReuseRanges()
Returns the aux range caching policy. If true, aux ranges will be calculated only once, if false they will be recalculated when the surface changes.

Returns:
  aux range caching policy

### setUsePlans

public void setUsePlans(boolean usePlans)
Sets plan caching policy. If true, plan objects will be retained following a plot and used as input to the next plotting attempt; if false, no plans will be cached.

Parameters:
  `usePlans` - drawing plan caching policy
See Also:
  - `Drawing.calculatePlan(Object[], DataStore)`

### getUsePlans

public boolean getUsePlans()
Returns the plan caching policy. If true, plan objects will be retained following a plot and used as input to the next plotting attempt; if false, no plans will be cached.

Returns:
  drawing plan caching policy
See Also:
  - `Drawing.calculatePlan(Object[], DataStore)`

### createFullyCached

public static PlotCaching createFullyCached()
Returns an instance in which as much as possible is cached between plot frames.

Returns:
  aggressively caching instance

### createUncached

public static PlotCaching createUncached()
Returns an instance in which nothing is cached between plot frames.

Returns:
  non-caching instance