drasys.or.geom
Interface PointIndexI

All Known Implementing Classes:
KDTree

public interface PointIndexI

A generic interface to an index with point keys.

See Also:
KDTree

Method Summary
 CoordinateSystemI coordinateSystem()
          Returns the coordinate system that the index is using.
 java.util.Enumeration elements()
          Returns an enumeration to access all of the elements in random order.
 java.lang.Object get(PointI key)
          Returns the value of the element whose key exactly matches 'key'.
 PairI getNearestNeighborTo(PointI point)
          Returns the element with the nearest key.
 void put(PointI key, java.lang.Object value)
          Put a new element into the index.
 RangeI range()
          Returns the range of points in the index.
 void removeAllElements()
          Removes all of the elements from the index.
 java.util.Enumeration selectedElements()
          Returns an enumeration to access the selected elements in random order.
 int selectNearestNeighbors(PointI point, int n)
          Select the 'n' elements whose keys are closest to 'point'.
 int selectRange(RangeI range)
          Select the elements whose keys are in the range.
 void setCoordinateSystem(CoordinateSystemI coordinateSystem)
          Sets the coordinate system for the index after first removing all the elements.
 int size()
          Returns the number of elements in the index.
 int sizeOfSelected()
          Returns the number of elements selected in the index.
 boolean supportsDuplicateKeys()
          Returns true if the index can contain duplicate keys.
 

Method Detail

size

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

sizeOfSelected

public int sizeOfSelected()
Returns the number of elements selected in the index.

removeAllElements

public void removeAllElements()
Removes all of the elements from the index.

setCoordinateSystem

public void setCoordinateSystem(CoordinateSystemI coordinateSystem)
Sets the coordinate system for the index after first removing all the elements.
Returns:
'null' if the index is not set.

coordinateSystem

public CoordinateSystemI coordinateSystem()
Returns the coordinate system that the index is using.
Returns:
'null' if the coordinate system is not set.

supportsDuplicateKeys

public boolean supportsDuplicateKeys()
Returns true if the index can contain duplicate keys.

put

public void put(PointI key,
                java.lang.Object value)
Put a new element into the index.
Returns:
A PairI interface where PairI.getFirst() returns the key and PairI.getSecond() returns the value.

get

public java.lang.Object get(PointI key)
Returns the value of the element whose key exactly matches 'key'.

getNearestNeighborTo

public PairI getNearestNeighborTo(PointI point)
Returns the element with the nearest key.
Returns:
A PairI interface where PairI.getFirst() returns the key and PairI.getSecond() returns the value.

selectNearestNeighbors

public int selectNearestNeighbors(PointI point,
                                  int n)
Select the 'n' elements whose keys are closest to 'point'. A call to this method may invalidate previous selection enumerations.
Returns:
the number of elements selected.

selectRange

public int selectRange(RangeI range)
Select the elements whose keys are in the range. A call to this method may invalidate previous selection enumerations. Calling this method may invalidate any previously returned enumerations.
Returns:
the number of elements selected.

elements

public java.util.Enumeration elements()
Returns an enumeration to access all of the elements in random order.
Returns:
An enumeration of PairI interfaces where PairI.getFirst() returns the key and PairI.getSecond() returns the value.

selectedElements

public java.util.Enumeration selectedElements()
Returns an enumeration to access the selected elements in random order.
Returns:
An enumeration of PairI interfaces where PairI.getFirst() returns the key and PairI.getSecond() returns the value.

range

public RangeI range()
Returns the range of points in the index.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com