org.hypergraphdb
Interface HGSearchResult<T>

All Superinterfaces:
CloseMe, java.util.Iterator<T>, TwoWayIterator<T>
All Known Subinterfaces:
HGRandomAccessResult<ValueType>, RSCombiner<T>
All Known Implementing Classes:
FilteredResultSet, HandleArrayResultSet, IndexResultSet, InMemoryIntersectionResult, KeyScanResultSet, LinkTargetsResultSet, MappedResult, PipedResult, ProjectionAtomResultSet, SingleKeyResultSet, SingleValueResultSet, SortedIntersectionResult, TraversalResult, UnionResult, ZigZagIntersectionResult

public interface HGSearchResult<T>
extends TwoWayIterator<T>, CloseMe

Represents the result set of a HyperGraph query.

Author:
Borislav Iordanov

Field Summary
static HGRandomAccessResult<? extends java.lang.Object> EMPTY
           This object represents an empty HGSearchResult.
 
Method Summary
 void close()
          Free all system resources held up by the result set and invalidate it for further use.
 T current()
          Returns the current element in the result set.
 boolean isOrdered()
          Return true if the elements in this search result are in ordered and false otherwise.
 
Methods inherited from interface org.hypergraphdb.TwoWayIterator
hasPrev, prev
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Field Detail

EMPTY

static final HGRandomAccessResult<? extends java.lang.Object> EMPTY

This object represents an empty HGSearchResult. Calls to hasPrev or hasNext will always return false. Calls to current, next or prev will always throw a NoSuchElementException.

Method Detail

current

T current()

Returns the current element in the result set. If there is no current element, java.util.NoSuchElementException is thrown. There is no current element in one of two cases: either the result set is empty or the next method was never invoked.

Returns:
The current element in a HGSearchResult.

close

void close()

Free all system resources held up by the result set and invalidate it for further use.

Specified by:
close in interface CloseMe

isOrdered

boolean isOrdered()

Return true if the elements in this search result are in ordered and false otherwise. It is assumed that when elements are ordered, they are instances of java.lang.Comparable