visad.data
Class CachedFlatField
- java.lang.Object
-
- visad.ThingImpl
-
- visad.DataImpl
-
- visad.FunctionImpl
-
- visad.FieldImpl
-
- visad.FlatField
-
- visad.data.CachedFlatField
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Data, Field, FlatFieldIface, Function, Thing
public class CachedFlatField extends FlatField
This is a FloatField that caches to disk its float array.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class visad.DataImpl
DataImpl.Syncher
-
-
Field Summary
Fields Modifier and Type Field and Description intmycnt-
Fields inherited from interface visad.Data
ABS, ACOS, ACOS_DEGREES, ADD, ASIN, ASIN_DEGREES, ATAN, ATAN_DEGREES, ATAN2, ATAN2_DEGREES, CEIL, COS, COS_DEGREES, DEGREES_TO_RADIANS, DEPENDENT, DIVIDE, EXP, FLOOR, INDEPENDENT, INV_ATAN2, INV_ATAN2_DEGREES, INV_DIVIDE, INV_POW, INV_REMAINDER, INV_SUBTRACT, LOG, MAX, MIN, MULTIPLY, NEAREST_NEIGHBOR, NEGATE, NO_ERRORS, NOP, POW, RADIANS_TO_DEGREES, REMAINDER, RINT, ROUND, SIN, SIN_DEGREES, SQRT, SUBTRACT, TAN, TAN_DEGREES, WEIGHTED_AVERAGE
-
-
Constructor Summary
Constructors Constructor and Description CachedFlatField(CachedFlatField that, boolean copy, FunctionType type, Set domainSet, CoordinateSystem rangeCoordSys, CoordinateSystem[] rangeCoordSysArray, Set[] rangeSets, Unit[] units)Copy constructorCachedFlatField(FunctionType type, float[][] floats)Create a new CachedFlatFieldCachedFlatField(FunctionType type, Set domainSet)Create a new CachedFlatFieldCachedFlatField(FunctionType type, Set domainSet, CoordinateSystem rangeCoordSys, CoordinateSystem[] rangeCoordSyses, Set[] rangeSets, Unit[] units, float[][] floats)Create a new CachedFlatFieldCachedFlatField(FunctionType type, Set domainSet, CoordinateSystem rangeCoordSys, Set[] rangeSets, Unit[] units, float[][] floats)Create a new CachedFlatFieldCachedFlatField(FunctionType type, Set domainSet, float[][] floats)Create a new CachedFlatField
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearCachedRange()Clear the cached rangesjava.lang.Objectclone()Override method so we clear the caches on the cloned objectCachedFlatFieldcloneMe(boolean copy, FunctionType type, Set domainSet, CoordinateSystem rangeCoordSys, CoordinateSystem[] rangeCoordSysArray, Set[] rangeSets, Unit[] units)Clone this objectvoidfinalize()DataRange[]getRanges()Get the rangesDataRange[]getRanges(boolean force)Get the rangesDataRange[]getRanges(float[][] values)Get the ranges for the valuesDatagetSample(int index)Get the range value at the index-th sample.booleanhaveData()voidmsg(java.lang.String s)Debug statmentfloat[][]readData()Used to provide a hook to derived classes to dynamically read in the datavoidsetSampleRanges(DataRange[] sampleRanges)Set the sample rangesvoidsetSamples(float[][] values, ErrorEstimate[] errors, boolean copy)Set the samplefloat[][]unpackFloats(boolean copy)get the float values-
Methods inherited from class visad.FlatField
adjustSamplingError, binary, clearMissing, computeRanges, convertToField, derivative, derivative, derivative, derivative, derivative, equals, extract, extract, fillField, getDefaultRangeUnits, getFloats, getFloats, getRangeCoordinateSystem, getRangeCoordinateSystem, getRangeDimension, getRangeErrors, getRangeSets, getRangeUnits, getSample, getStringValues, getValues, getValues, getValues, grabBytes, isFlatField, isMissing, longString, main, makeField, makeField1, makeField2, resample, resampleDouble, setRangeErrors, setSample, setSample, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, toString, unary, unpackFloats, unpackValues
-
Methods inherited from class visad.FieldImpl
__getitem__, __len__, __setitem__, __setitem__, combine, combine, combine, combine, combine, domainEnumeration, domainFactor, domainFactor, domainMultiply, domainMultiply, domainMultiply, domainMultiply, extract, extract, getDomainCoordinateSystem, getDomainSet, getDomainUnits, getLength, setSample, setSample, setSample, setSamples
-
Methods inherited from class visad.FunctionImpl
__getitem__, __getitem__, evaluate, evaluate, evaluate, evaluate, getDomainDimension, resample
-
Methods inherited from class visad.DataImpl
__add__, __add__, __div__, __div__, __mod__, __mod__, __mul__, __mul__, __neg__, __pow__, __pow__, __radd__, __rdiv__, __rmod__, __rmul__, __rpow__, __rsub__, __sub__, __sub__, abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, notifyReferences, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary
-
Methods inherited from class visad.ThingImpl
addReference, removeReference
-
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface visad.Field
domainEnumeration, domainFactor, domainMultiply, domainMultiply, getDomainSet, getLength, setSample, setSample
-
Methods inherited from interface visad.Function
evaluate, evaluate, evaluate, evaluate, getDomainCoordinateSystem, getDomainDimension, getDomainUnits, resample
-
Methods inherited from interface visad.Data
abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary
-
Methods inherited from interface visad.Thing
addReference, removeReference
-
-
-
-
Constructor Detail
-
CachedFlatField
public CachedFlatField(FunctionType type, Set domainSet) throws VisADException
Create a new CachedFlatField- Parameters:
type- Function typedomainSet- set for this- Throws:
VisADException- On badness
-
CachedFlatField
public CachedFlatField(FunctionType type, float[][] floats) throws VisADException
Create a new CachedFlatField- Parameters:
floats- The valuestype- Function type- Throws:
VisADException- On badness
-
CachedFlatField
public CachedFlatField(FunctionType type, Set domainSet, float[][] floats) throws VisADException
Create a new CachedFlatField- Parameters:
floats- The valuestype- Function typedomainSet- Domain- Throws:
VisADException- On badness
-
CachedFlatField
public CachedFlatField(FunctionType type, Set domainSet, CoordinateSystem rangeCoordSys, Set[] rangeSets, Unit[] units, float[][] floats) throws VisADException
Create a new CachedFlatField- Parameters:
type- Function typedomainSet- DomainrangeCoordSys- range CoordSystemrangeSets- range setsunits- unitsfloats- The values- Throws:
VisADException- On badness
-
CachedFlatField
public CachedFlatField(FunctionType type, Set domainSet, CoordinateSystem rangeCoordSys, CoordinateSystem[] rangeCoordSyses, Set[] rangeSets, Unit[] units, float[][] floats) throws VisADException
Create a new CachedFlatField- Parameters:
type- Function typedomainSet- DomainrangeCoordSys- range CoordSystemrangeCoordSyses- range CoordSystem'srangeSets- range setsunits- unitsfloats- The values- Throws:
VisADException- On badness
-
CachedFlatField
public CachedFlatField(CachedFlatField that, boolean copy, FunctionType type, Set domainSet, CoordinateSystem rangeCoordSys, CoordinateSystem[] rangeCoordSysArray, Set[] rangeSets, Unit[] units) throws VisADException
Copy constructor- Parameters:
that- What we clone fromcopy- copy the valuestype- Function typedomainSet- DomainrangeCoordSys- range CoordSystemrangeCoordSysArray- rangeCoordSysArrayrangeSets- range setsunits- units- Throws:
VisADException- On badness
-
-
Method Detail
-
cloneMe
public CachedFlatField cloneMe(boolean copy, FunctionType type, Set domainSet, CoordinateSystem rangeCoordSys, CoordinateSystem[] rangeCoordSysArray, Set[] rangeSets, Unit[] units) throws VisADException
Clone this object- Parameters:
copy- copy the valuestype- Function typedomainSet- Domain setrangeCoordSys- range CoordSystemrangeCoordSysArray- rangeCoordSysArrayrangeSets- range setsunits- units- Returns:
- New field
- Throws:
VisADException- On badness
-
finalize
public void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
setSamples
public void setSamples(float[][] values, ErrorEstimate[] errors, boolean copy) throws VisADException, java.rmi.RemoteExceptionSet the sample- Specified by:
setSamplesin interfaceFlatFieldIface- Overrides:
setSamplesin classFlatField- Parameters:
values- the sampleserrors- errorscopy- tru to copy- Throws:
java.rmi.RemoteException- Java RMI ExceptionVisADException- Problem in VisAD land
-
clone
public java.lang.Object clone()
Override method so we clear the caches on the cloned object
-
setSampleRanges
public void setSampleRanges(DataRange[] sampleRanges)
Set the sample ranges- Parameters:
sampleRanges- the sample ranges
-
clearCachedRange
public void clearCachedRange()
Clear the cached ranges
-
getRanges
public DataRange[] getRanges() throws VisADException
Get the ranges- Returns:
- ranges
- Throws:
VisADException- problem getting ranges
-
getRanges
public DataRange[] getRanges(boolean force) throws VisADException
Get the ranges- Parameters:
force- force a recalc- Returns:
- ranges the ranges
- Throws:
VisADException- problem getting ranges
-
getRanges
public DataRange[] getRanges(float[][] values) throws VisADException
Get the ranges for the values- Parameters:
values- the values- Returns:
- the ranges
- Throws:
VisADException- Problem in VisAD land
-
readData
public float[][] readData()
Used to provide a hook to derived classes to dynamically read in the data- Returns:
- data
-
msg
public void msg(java.lang.String s)
Debug statment- Parameters:
s- message to print
-
haveData
public boolean haveData()
-
getSample
public Data getSample(int index) throws VisADException, java.rmi.RemoteException
Get the range value at the index-th sample.- Specified by:
getSamplein interfaceField- Overrides:
getSamplein classFlatField- Parameters:
index- index of the sample- Returns:
- Data object (Real, RealTuple, or Tuple) corresponding to the range at the index-th sample.
- Throws:
VisADException- problem getting datajava.rmi.RemoteException- problem getting data from remote object
-
unpackFloats
public float[][] unpackFloats(boolean copy) throws VisADExceptionget the float values- Parameters:
copy- copy the values- Returns:
- The values
- Throws:
VisADException- On badness
-
-
DMelt 3.0 © DataMelt by jWork.ORG