Class ORecordIteratorCluster<REC extends ORecord>

java.lang.Object
com.orientechnologies.orient.core.iterator.OIdentifiableIterator<REC>
com.orientechnologies.orient.core.iterator.ORecordIteratorCluster<REC>
All Implemented Interfaces:
Iterable<REC>, Iterator<REC>

public class ORecordIteratorCluster<REC extends ORecord> extends OIdentifiableIterator<REC>
Iterator class to browse forward and backward the records of a cluster. Once browsed in a direction, the iterator cannot change it.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Constructor Details

  • Method Details

    • hasPrevious

      public boolean hasPrevious()
      Specified by:
      hasPrevious in class OIdentifiableIterator<REC extends ORecord>
    • hasNext

      public boolean hasNext()
    • previous

      public REC previous()
      Return the element at the current position and move backward the stream to the previous position available.
      Specified by:
      previous in class OIdentifiableIterator<REC extends ORecord>
      Returns:
      the previous record found, otherwise the NoSuchElementException exception is thrown when no more records are found.
    • next

      public REC next()
      Return the element at the current position and move forward the stream to the next position available.
      Returns:
      the next record found, otherwise the NoSuchElementException exception is thrown when no more records are found.
    • begin

      public ORecordIteratorCluster<REC> begin()
      Move the iterator to the begin of the range. If no range was specified move to the first record of the cluster.
      Specified by:
      begin in class OIdentifiableIterator<REC extends ORecord>
      Returns:
      The object itself
    • last

      public ORecordIteratorCluster<REC> last()
      Move the iterator to the end of the range. If no range was specified move to the last record of the cluster.
      Specified by:
      last in class OIdentifiableIterator<REC extends ORecord>
      Returns:
      The object itself
    • setLiveUpdated

      public ORecordIteratorCluster<REC> setLiveUpdated(boolean iLiveUpdated)
      Tell to the iterator that the upper limit must be checked at every cycle. Useful when concurrent deletes or additions change the size of the cluster while you're browsing it. Default is false.
      Overrides:
      setLiveUpdated in class OIdentifiableIterator<REC extends ORecord>
      Parameters:
      iLiveUpdated - True to activate it, otherwise false (default)
      See Also: