org.geotools.coverage.processing
Class RangeSpecifier

java.lang.Object
  extended by org.geotools.coverage.processing.RangeSpecifier
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class RangeSpecifier
extends java.lang.Object
implements java.io.Serializable, org.opengis.util.Cloneable

Argument type for DefaultProcessor operations for specifying the range, colors and units of a computation result. RangeSpecifier are used for tuning the Category object to be constructed. For example the "GradientMagnitude" operation will produces new GridCoverage2D with sample values ranging from 0 to some maximal value which may be very different from the source GridCoverage2D range. By default, most operations try to guess a raisonable range for output values. This default behavior can be overridden with an explicit RangeSpecifier argument.

All RangeSpecifier's properties are optional; it is up to processor's operation to replace null values by a default one.

Since:
2.2
Version:
$Id: RangeSpecifier.java 30760 2008-06-18 14:28:24Z desruisseaux $
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form

Constructor Summary
RangeSpecifier()
          Constructs a default RangeSpecifier with no value set.
RangeSpecifier(org.opengis.referencing.operation.MathTransform1D transform)
          Constructs a RangeSpecifier initialised to the specified "sample to geophysics" transform.
RangeSpecifier(NumberRange<?> range)
          Constructs a RangeSpecifier initialised to the spĂ©cified range.
 
Method Summary
 RangeSpecifier clone()
          Returns a clone of this object.
 boolean equals(java.lang.Object object)
          Compares this range specifier with the specified object for equality.
 java.awt.Color[] getColors()
          Returns the target colors, or null if none.
 NumberRange<?> getRange()
          Returns the target range, or null if none.
 org.opengis.referencing.operation.MathTransform1D getSampleToGeophysics()
          Returns the target "sample to geophysics" transform, or null if none.
 javax.measure.unit.Unit<?> getUnit()
          Returns the target range units, or null if none.
 int hashCode()
          Returns a hash code value for this range specifier.
 void setColors(java.awt.Color[] colors)
          Set the target colors to the specified value.
 void setRange(NumberRange<?> range)
          Set the target range to the specified values.
 void setSampleToGeophysics(org.opengis.referencing.operation.MathTransform1D transform)
          Set the target "sample to geophysics" transform to the specified value.
 void setUnit(javax.measure.unit.Unit<?> unit)
          Set the target range units to the specified value.
 java.lang.String toString()
          Returns a string representation of this range specifier.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RangeSpecifier

public RangeSpecifier()
Constructs a default RangeSpecifier with no value set.


RangeSpecifier

public RangeSpecifier(NumberRange<?> range)
Constructs a RangeSpecifier initialised to the spécified range.

Parameters:
range - The range

RangeSpecifier

public RangeSpecifier(org.opengis.referencing.operation.MathTransform1D transform)
Constructs a RangeSpecifier initialised to the specified "sample to geophysics" transform.

Parameters:
transform - The sample to geophysics transform.
Method Detail

getRange

public NumberRange<?> getRange()
Returns the target range, or null if none.

Returns:
The range

setRange

public void setRange(NumberRange<?> range)
Set the target range to the specified values. Setting this property will clear the sample to geophysics transform, since those properties are mutually exclusive.

Parameters:
range - The target range.

getSampleToGeophysics

public org.opengis.referencing.operation.MathTransform1D getSampleToGeophysics()
Returns the target "sample to geophysics" transform, or null if none.

Returns:
The current sample to geophysics transform.

setSampleToGeophysics

public void setSampleToGeophysics(org.opengis.referencing.operation.MathTransform1D transform)
Set the target "sample to geophysics" transform to the specified value. Setting this property will clear the range property, since those properties are mutually exclusive.

Parameters:
transform - The new sample to geophysics transform.

getUnit

public javax.measure.unit.Unit<?> getUnit()
Returns the target range units, or null if none.

Returns:
The current units.

setUnit

public void setUnit(javax.measure.unit.Unit<?> unit)
Set the target range units to the specified value.

Parameters:
unit - The new units.

getColors

public java.awt.Color[] getColors()
Returns the target colors, or null if none.

Returns:
The current colors.

setColors

public void setColors(java.awt.Color[] colors)
Set the target colors to the specified value.

Parameters:
colors - The new colors.

clone

public RangeSpecifier clone()
Returns a clone of this object.

Overrides:
clone in class java.lang.Object
Returns:
A clone of this object.

hashCode

public int hashCode()
Returns a hash code value for this range specifier.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Compares this range specifier with the specified object for equality.

Overrides:
equals in class java.lang.Object
Parameters:
object - The object to compare with.
Returns:
true if the given object is equals to this range specifier.

toString

public java.lang.String toString()
Returns a string representation of this range specifier.

Overrides:
toString in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.