org.geotools.referencing.piecewise
Class DefaultDomain1D<E extends DefaultDomainElement1D>

Object
  extended by AbstractCollection<E>
      extended by AbstractList<E>
          extended by DefaultDomain1D<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, Domain1D<E>
Direct Known Subclasses:
DefaultPiecewiseTransform1D

public class DefaultDomain1D<E extends DefaultDomainElement1D>
extends AbstractList<E>
implements Domain1D<E>

Convenience implementation of the Domain1D interface.

Author:
Simone Giannecchini

Field Summary
 
Fields inherited from class AbstractList
modCount
 
Constructor Summary
DefaultDomain1D(E[] inDomainElements)
          Constructor for DefaultDomain1D.
 
Method Summary
 boolean equals(Object object)
          Compares the specified object with this domain element list for equality.
 E findDomainElement(double value)
          Returns the domain element of the specified sample value.
 E get(int i)
          Returns the element at the specified position in this list.
 NumberRange<? extends Number> getApproximateDomainRange()
          Returns the range of values in this Domain1D.
protected  Class<?> getEquivalenceClass()
           
 E getMain()
          Return what seems to be the main DomainElement1D for this list.
 double[] getMinimums()
           
 InternationalString getName()
          Returns the name of this object.
 boolean hasGaps()
          Tell us if there is a gap in this Domain1D which means a range where no DomainElement1D is defined.
 int hashCode()
           
 int size()
          Returns the number of elements in this list.
 Object[] toArray()
          Returns all elements in this .
 
Methods inherited from class AbstractList
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface List
add, add, addAll, addAll, clear, contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray
 

Constructor Detail

DefaultDomain1D

public DefaultDomain1D(E[] inDomainElements)
Constructor for DefaultDomain1D.

Parameters:
inDomainElements - DomainElement1D objects that make up this list.
Method Detail

getName

public InternationalString getName()
Description copied from interface: Domain1D
Returns the name of this object. The default implementation returns the name of what seems to be the "main" domain element (i.e. the domain element with the widest range of values).

Specified by:
getName in interface Domain1D<E extends DefaultDomainElement1D>

getApproximateDomainRange

public NumberRange<? extends Number> getApproximateDomainRange()
Description copied from interface: Domain1D
Returns the range of values in this Domain1D. This is the union of the range of values of every Domain1D.

Specified by:
getApproximateDomainRange in interface Domain1D<E extends DefaultDomainElement1D>
Returns:
The range of values.

findDomainElement

public E findDomainElement(double value)
Returns the domain element of the specified sample value. If no domain element fits, then this method returns null.

Specified by:
findDomainElement in interface Domain1D<E extends DefaultDomainElement1D>
Parameters:
value - The value.
Returns:
The domain element of the supplied value, or null.

size

public int size()
Returns the number of elements in this list.

Specified by:
size in interface Collection<E extends DefaultDomainElement1D>
Specified by:
size in interface List<E extends DefaultDomainElement1D>
Specified by:
size in class AbstractCollection<E extends DefaultDomainElement1D>

get

public E get(int i)
Returns the element at the specified position in this list.

Specified by:
get in interface List<E extends DefaultDomainElement1D>
Specified by:
get in class AbstractList<E extends DefaultDomainElement1D>

toArray

public Object[] toArray()
Returns all elements in this .

Specified by:
toArray in interface Collection<E extends DefaultDomainElement1D>
Specified by:
toArray in interface List<E extends DefaultDomainElement1D>
Overrides:
toArray in class AbstractCollection<E extends DefaultDomainElement1D>

equals

public boolean equals(Object object)
Compares the specified object with this domain element list for equality. If the two objects are instances of the DefaultDomain1D class, then the test check for the equality of the single elements.

Specified by:
equals in interface Collection<E extends DefaultDomainElement1D>
Specified by:
equals in interface List<E extends DefaultDomainElement1D>
Overrides:
equals in class AbstractList<E extends DefaultDomainElement1D>

getEquivalenceClass

protected Class<?> getEquivalenceClass()

hasGaps

public boolean hasGaps()
Description copied from interface: Domain1D
Tell us if there is a gap in this Domain1D which means a range where no DomainElement1D is defined.

Specified by:
hasGaps in interface Domain1D<E extends DefaultDomainElement1D>
Returns:
true in case a gap exists, false otherwise.

getMain

public E getMain()
Return what seems to be the main DomainElement1D for this list.

Returns:
what seems to be the main DomainElement1D for this list.

getMinimums

public double[] getMinimums()
Returns:

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<E extends DefaultDomainElement1D>
Specified by:
hashCode in interface List<E extends DefaultDomainElement1D>
Overrides:
hashCode in class AbstractList<E extends DefaultDomainElement1D>


Copyright © 1996-2009 Geotools. All Rights Reserved.