visad.data.in
Class OffsetUnpacker

java.lang.Object
  extended by visad.data.in.ValueProcessor
      extended by visad.data.in.ValueUnpacker
          extended by visad.data.in.OffsetUnpacker

public final class OffsetUnpacker
extends ValueUnpacker

Provides support for unpacking data values by adding a constant offset to them.

Instances are immutable.

Author:
Steven R. Emmerson

Field Summary
 
Fields inherited from class visad.data.in.ValueProcessor
trivialProcessor
 
Method Summary
 boolean equals(Object obj)
          Indicates if this instance is semantically identical to another object.
 int hashCode()
          Returns the hash code of this instance.
static OffsetUnpacker offsetUnpacker(double offset)
          Returns an instance of this class corresponding to an offset value.
 double process(double value)
          Process a value.
 double[] process(double[] values)
          Process values.
 float process(float value)
          Process a value.
 float[] process(float[] values)
          Process values.
 
Methods inherited from class visad.data.in.ValueUnpacker
getIncrement, valueUnpacker
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

offsetUnpacker

public static OffsetUnpacker offsetUnpacker(double offset)
Returns an instance of this class corresponding to an offset value.

Parameters:
offset - The numeric offset to be added to each value during processing.
Returns:
An instance of this class corresponding to the input argument.

process

public float process(float value)
Process a value.

Specified by:
process in class ValueProcessor
Parameters:
value - The value to be processed.
Returns:
The value with the construction offset added to it.

process

public double process(double value)
Process a value.

Specified by:
process in class ValueProcessor
Parameters:
value - The value to be processed.
Returns:
The value with the construction offset added to it.

process

public float[] process(float[] values)
Process values.

Specified by:
process in class ValueProcessor
Parameters:
values - The values to be processed.
Returns:
The values with the construction offset added to them. The same array is returned.

process

public double[] process(double[] values)
Process values.

Specified by:
process in class ValueProcessor
Parameters:
values - The values to be processed.
Returns:
The values with the construction offset added to them. The same array is returned.

equals

public boolean equals(Object obj)
Indicates if this instance is semantically identical to another object.

Overrides:
equals in class Object
Parameters:
obj - The other object.
Returns:
true if and only if this instance is semantically identical to the other object.

hashCode

public int hashCode()
Returns the hash code of this instance.

Overrides:
hashCode in class Object
Returns:
The hash code of this instance.