org.geotools.referencing.piecewise
Class DefaultDomainElement1D

java.lang.Object
  extended by org.geotools.referencing.piecewise.DefaultDomainElement1D
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DomainElement1D>, DomainElement1D
Direct Known Subclasses:
DefaultPiecewiseTransform1DElement

public class DefaultDomainElement1D
extends java.lang.Object
implements DomainElement1D

This class implements the DomainElement1D interface in order to provide basic capabilities for DomainElement1D subclasses.

Author:
Simone Giannecchini, GeoSolutions.
See Also:
Serialized Form

Constructor Summary
DefaultDomainElement1D(java.lang.CharSequence name, NumberRange<?> inputRange)
          Abstract domain element constructor.
 
Method Summary
 int compareTo(DomainElement1D o)
          Base implementation for the Comparable.compareTo(Object) method.
 boolean contains(double value)
          This methods can be used to check whether or not a given value belongs to DomainElement1D.
 boolean contains(java.lang.Number value)
          This methods can be used to check whether or not a given value belongs to DomainElement1D.
 boolean contains(NumberRange<? extends java.lang.Number> range)
          This methods can be used to check whether or not a given NumberRange belongs to DomainElement1D.
 boolean equals(java.lang.Object obj)
          Implementation of Object.equals(Object) for DomainElement1Ds.
protected  java.lang.Class<?> getEquivalenceClass()
           
 double getInputMaximum()
          Retrieves the upper bound of the range where this DomainElement1D is defined.
 double getInputMinimum()
          Retrieves the lower bound of the range where this DomainElement1D is defined.
 org.opengis.util.InternationalString getName()
          Getter method for this DomainElement1D 's name.
 NumberRange<? extends java.lang.Number> getRange()
          This method retrieves the input range.
 int hashCode()
          Returns a hash value for this domain element.
 boolean isInputMaximumInfinite()
          Tells us if the upper bound of the range where this DomainElement1D is defined is an infinite number
 boolean isInputMaximumNaN()
          Tells us if the upper bound of the range where this DomainElement1D is defined is NaN.
 boolean isInputMinimumInfinite()
          Tells us if the lower bound of the range where this DomainElement1D is defined is an infinite number.
 boolean isInputMinimumNaN()
          Tells us if the lower bound of the range where this DomainElement1D is defined is NaN
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDomainElement1D

public DefaultDomainElement1D(java.lang.CharSequence name,
                              NumberRange<?> inputRange)
                       throws java.lang.IllegalArgumentException
Abstract domain element constructor.

It builds up an DefaultDomainElement1D with the provided name and input range.

Parameters:
name - for this DefaultDomainElement1D.
range - for this DefaultDomainElement1D.
Throws:
java.lang.IllegalArgumentException - in case one of the input arguments is invalid.
Method Detail

compareTo

public int compareTo(DomainElement1D o)
Base implementation for the Comparable.compareTo(Object) method. This method will work only if the provided input object is a DefaultDomainElement1D.

Two DefaultDomainElement1Ds are compared by comparing their lower bounds in order to establish an order between them.

Specified by:
compareTo in interface java.lang.Comparable<DomainElement1D>
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Object.
See Also:
Comparable.compareTo(Object)

equals

public boolean equals(java.lang.Object obj)
Implementation of Object.equals(Object) for DomainElement1Ds.

Two DefaultDomainElement1Ds are considered to be equal if they have the same inputr range and the same name.

Specified by:
equals in interface DomainElement1D
Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.equals(Object)

getEquivalenceClass

protected java.lang.Class<?> getEquivalenceClass()

contains

public boolean contains(java.lang.Number value)
Description copied from interface: DomainElement1D
This methods can be used to check whether or not a given value belongs to DomainElement1D.

Specified by:
contains in interface DomainElement1D
Parameters:
value - to check for the inclusion.
Returns:
true if the value belongs to this DomainElement1D, false otherwise.
See Also:
DomainElement1D.contains(Number)

contains

public boolean contains(NumberRange<? extends java.lang.Number> range)
Description copied from interface: DomainElement1D
This methods can be used to check whether or not a given NumberRange belongs to DomainElement1D.

Specified by:
contains in interface DomainElement1D
Returns:
true if the NumberRange belongs to this DomainElement1D, false otherwise.
See Also:
DomainElement1D.contains(NumberRange)

contains

public boolean contains(double value)
Description copied from interface: DomainElement1D
This methods can be used to check whether or not a given value belongs to DomainElement1D.

Specified by:
contains in interface DomainElement1D
Parameters:
value - to check for the inclusion.
Returns:
true if the value belongs to this DomainElement1D, false otherwise.
See Also:
DomainElement1D.contains(double)

hashCode

public int hashCode()
Returns a hash value for this domain element. This value need not remain consistent between different implementations of the same class.

Overrides:
hashCode in class java.lang.Object

getName

public org.opengis.util.InternationalString getName()
Getter method for this DomainElement1D 's name.

Specified by:
getName in interface DomainElement1D
Returns:
this DefaultDomainElement1D 's name.

getInputMaximum

public double getInputMaximum()
Retrieves the upper bound of the range where this DomainElement1D is defined.

This is just a convenience method

Returns:
the upper bound of the range where this DomainElement1D is defined.

isInputMaximumInfinite

public boolean isInputMaximumInfinite()
Tells us if the upper bound of the range where this DomainElement1D is defined is an infinite number

This is just a convenience method

Returns:
true if the upper bound of the range where this DomainElement1D is defined is infinite, false otherwise.

isInputMaximumNaN

public boolean isInputMaximumNaN()
Tells us if the upper bound of the range where this DomainElement1D is defined is NaN.

This is just a convenience method

Returns:
true if the upper bound of the range where this DomainElement1D is defined is NaN, false otherwise.

getInputMinimum

public double getInputMinimum()
Retrieves the lower bound of the range where this DomainElement1D is defined.

This is just a convenience method

Returns:
the lower bound of the range where this DomainElement1D is defined.

isInputMinimumInfinite

public boolean isInputMinimumInfinite()
Tells us if the lower bound of the range where this DomainElement1D is defined is an infinite number.

This is just a convenience method

Returns:
true if the lower bound of the range where this DomainElement1D is defined is infinite, false otherwise.

getRange

public NumberRange<? extends java.lang.Number> getRange()
This method retrieves the input range.

Specified by:
getRange in interface DomainElement1D
Returns:
the input range.

isInputMinimumNaN

public boolean isInputMinimumNaN()
Tells us if the lower bound of the range where this DomainElement1D is defined is NaN

This is just a convenience method

Returns:
true if the lower bound of the range where this DomainElement1D is defined is NaN, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.