com.linkedin.data.it
Interface DataIterator

All Known Implementing Classes:
FilterIterator, ObjectIterator

public interface DataIterator

A DataIterator provides next() method for iterate through a acyclic graph of Data objects.

A DataIterator is different from a Iterator in that it's next() method returns null if there isn't a next DataElement, and it does not have a Iterator.hasNext() method.

Unlike Iterator, it has a skipToSibling() to instruct the DataIterator to skip to the next sibling.


Method Summary
 DataElement next()
          Return a DataElement that represents the next Data object in the graph.
 void skipToSibling()
          Instruct the DataIterator to skip to the next sibling, i.e.
 

Method Detail

next

DataElement next()
Return a DataElement that represents the next Data object in the graph. Unlike Iterator.next() this method returns null if there isn't a next Data object, and it does not throw a NoSuchElementException. The DataElement returned is valid until next() is called again. In others words, the next call to next() may invalidate or change the returned DataElement or its ancestors.

Returns:
a DataElement that represents the next Data object or return null if there isn't a next DataElement.

skipToSibling

void skipToSibling()
Instruct the DataIterator to skip to the next sibling, i.e. next invocation of next() should return a sibling of the last Data object visited and returned by the last invocation of next().