Class IntProcedureEntriesList

java.lang.Object
ucar.nc2.dt.ugrid.rtree.IntProcedureEntriesList
All Implemented Interfaces:
IntProcedure

public class IntProcedureEntriesList extends Object implements IntProcedure
The 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

    Constructors
    Constructor
    Description
    Initializes an empty instance of a IntProcedureEntriesList
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all elements from the internal list.
    boolean
    execute(int id)
    Caches the id passed from the calling method to the list.
    int
    get(int index)
    Returns the value of the element at the specified position in the internal list.
    int
    Returns the number of elements contained in this object's internal list.
    cern.colt.list.AbstractIntList
    Retrieves a deep copy of the internal entry list

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IntProcedureEntriesList

      public IntProcedureEntriesList()
      Initializes an empty instance of a IntProcedureEntriesList
  • 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:
      execute in interface IntProcedure
      Parameters:
      id - a node id (from an RTree)
      Returns:
      true if execution succeeds. Execution may be halted by returning false.
    • 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 IndexOutOfBoundsException
      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 int value 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