Package ucar.nc2.dt.ugrid.rtree
Class IntProcedureEntriesList
- java.lang.Object
-
- ucar.nc2.dt.ugrid.rtree.IntProcedureEntriesList
-
- All Implemented Interfaces:
IntProcedure
public class IntProcedureEntriesList extends Object implements IntProcedure
TheIntProcedureEntriesListclass provides an implementation of anIntProcedureand 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 withget(int)andgetValues(). These indices are returned asIntegerobjects.
-
-
Constructor Summary
Constructors Constructor Description IntProcedureEntriesList()Initializes an empty instance of aIntProcedureEntriesList
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()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.AbstractIntListgetValues()Retrieves a deep copy of the internal entry list
-
-
-
Method Detail
-
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
public int get(int index) throws IndexOutOfBoundsExceptionReturns 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
-
-