visad
Class CachingCoordinateSystem
- java.lang.Object
-
- visad.CoordinateSystem
-
- visad.CachingCoordinateSystem
-
- All Implemented Interfaces:
- java.io.Serializable
public class CachingCoordinateSystem extends CoordinateSystem
A wrapper class for CoordinateSystems that will cache the last values input and output values of the toReference and fromReference methods. If the inputs are the same as the last time these methods were called, the previously calculated values are returned.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static booleandebugTimeShow time to transform
-
Constructor Summary
Constructors Constructor and Description CachingCoordinateSystem(CoordinateSystem cs)Construct a new CachingCoordinateSystem that wraps around the input.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)Check for equality of CoordinateSystem objectsdouble[][]fromReference(double[][] inputs)Wrapper around the fromReference method of the input CoordinateSystem.float[][]fromReference(float[][] inputs)Wrapper around the fromReference method of the input CoordinateSystem.CoordinateSystemgetCachedCoordinateSystem()Access to the "cached" CSdouble[][]toReference(double[][] inputs)Wrapper around the toReference method of the input CoordinateSystem.float[][]toReference(float[][] inputs)Wrapper around the toReference method of the input CoordinateSystem.java.lang.StringtoString()A decriptive string of this CS.-
Methods inherited from class visad.CoordinateSystem
canConvert, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
-
-
-
-
Constructor Detail
-
CachingCoordinateSystem
public CachingCoordinateSystem(CoordinateSystem cs) throws VisADException
Construct a new CachingCoordinateSystem that wraps around the input.- Parameters:
cs- CoordinateSystem to wrap- Throws:
VisADException
-
-
Method Detail
-
toReference
public double[][] toReference(double[][] inputs) throws VisADExceptionWrapper around the toReference method of the input CoordinateSystem. If the inputs are the same as the last time this method was called, the previously computed outputs will be returned, otherwise the toReference method of the wrapped CS is called and it's output is returned- Specified by:
toReferencein classCoordinateSystem- Parameters:
inputs- values to transform- Returns:
- transformed input values.
- Throws:
VisADException- when wrapped CS does
-
fromReference
public double[][] fromReference(double[][] inputs) throws VisADExceptionWrapper around the fromReference method of the input CoordinateSystem. If the inputs are the same as the last time this method was called, the previously computed outputs will be returned, otherwise the fromReference method of the wrapped CS is called and it's output is returned- Specified by:
fromReferencein classCoordinateSystem- Parameters:
inputs- values to transform- Returns:
- transformed input values.
- Throws:
VisADException- when wrapped CS does
-
toReference
public float[][] toReference(float[][] inputs) throws VisADExceptionWrapper around the toReference method of the input CoordinateSystem. If the inputs are the same as the last time this method was called, the previously computed outputs will be returned, otherwise the toReference method of the wrapped CS is called and it's output is returned- Overrides:
toReferencein classCoordinateSystem- Parameters:
inputs- values to transform- Returns:
- transformed input values.
- Throws:
VisADException- when wrapped CS does
-
fromReference
public float[][] fromReference(float[][] inputs) throws VisADExceptionWrapper around the fromReference method of the input CoordinateSystem. If the inputs are the same as the last time this method was called, the previously computed outputs will be returned, otherwise the fromReference method of the wrapped CS is called and it's output is returned- Overrides:
fromReferencein classCoordinateSystem- Parameters:
inputs- values to transform- Returns:
- transformed input values.
- Throws:
VisADException- when wrapped CS does
-
equals
public boolean equals(java.lang.Object obj)
Check for equality of CoordinateSystem objects- Specified by:
equalsin classCoordinateSystem- Parameters:
obj- other object in question- Returns:
- true if the object in question is a CachingCoordinateSystem and it's CS is equal this object's CS
-
getCachedCoordinateSystem
public CoordinateSystem getCachedCoordinateSystem()
Access to the "cached" CS- Returns:
- cached CoordinateSystem
-
toString
public java.lang.String toString()
A decriptive string of this CS.- Overrides:
toStringin classjava.lang.Object- Returns:
- a descriptive String
-
-
DMelt 3.0 © DataMelt by jWork.ORG