Package ucar.nc2.dt.ugrid.rtree
Class IntProcedureEntriesList
java.lang.Object
ucar.nc2.dt.ugrid.rtree.IntProcedureEntriesList
- All Implemented Interfaces:
IntProcedure
The
Simply pass an instance of this class to an rtree search and access the retrieved nodes' indices with
IntProcedureEntriesList class provides an implementation of an IntProcedure and records
node id's from its
execution in a list.Simply pass an instance of this class to an rtree search and access the retrieved nodes' indices with
get(int) and
getValues(). These indices are returned as Integer objects.-
Constructor Summary
ConstructorsConstructorDescriptionInitializes an empty instance of aIntProcedureEntriesList -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all elements from the internal list.booleanexecute(int id) Caches the id passed from the calling method to the list.intget(int index) Returns the value of the element at the specified position in the internal list.intgetSize()Returns the number of elements contained in this object's internal list.cern.colt.list.AbstractIntListRetrieves a deep copy of the internal entry list
-
Constructor Details
-
IntProcedureEntriesList
public IntProcedureEntriesList()Initializes an empty instance of aIntProcedureEntriesList
-
-
Method Details
-
execute
public boolean execute(int id) Caches the id passed from the calling method to the list. This method is utilized primarily for the purpose of rtree searches and is usually not invoked explicitly- Specified by:
executein interfaceIntProcedure- Parameters:
id- a node id (from an RTree)- Returns:
trueif execution succeeds. Execution may be halted by returningfalse.
-
clear
public void clear()Removes all elements from the internal list. The list will be empty after this call returns, but will maintain its current capacity. -
get
Returns the value of the element at the specified position in the internal list.- Parameters:
index- the index of the element to return- Returns:
- the
intvalue of the entry at the given index - Throws:
IndexOutOfBoundsException- if index is out of range (index < 0 || index >= size())
-
getSize
public int getSize()Returns the number of elements contained in this object's internal list.- Returns:
- the number of elements contained in this object's internal list.
-
getValues
public cern.colt.list.AbstractIntList getValues()Retrieves a deep copy of the internal entry list- Returns:
- an
AbstractIntList
-