org.hypergraphdb.query.impl
Class LinkTargetsResultSet

java.lang.Object
  extended by org.hypergraphdb.query.impl.LinkTargetsResultSet
All Implemented Interfaces:
java.util.Iterator<HGHandle>, HGSearchResult<HGHandle>, TwoWayIterator<HGHandle>, CloseMe

public class LinkTargetsResultSet
extends java.lang.Object
implements HGSearchResult<HGHandle>

This is the same as HandleArrayResultSet, but it uses a loaded link atom instance instead of a HGHandle.

Author:
Borislav Iordanov

Field Summary
 
Fields inherited from interface org.hypergraphdb.HGSearchResult
EMPTY
 
Constructor Summary
LinkTargetsResultSet(HGLink l)
           
 
Method Summary
 void close()
          Free all system resources held up by the result set and invalidate it for further use.
 HGHandle current()
          Returns the current element in the result set.
 boolean hasNext()
           
 boolean hasPrev()
           Return true if there is a previous element in the current iteration state and false otherwise.
 boolean isOrdered()
          Return true if the elements in this search result are in ordered and false otherwise.
 HGHandle next()
           
 HGHandle prev()
           Returns the previous element in this iteration.
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkTargetsResultSet

public LinkTargetsResultSet(HGLink l)
Method Detail

close

public void close()
Description copied from interface: HGSearchResult

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

Specified by:
close in interface HGSearchResult<HGHandle>
Specified by:
close in interface CloseMe

current

public HGHandle current()
Description copied from interface: HGSearchResult

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.

Specified by:
current in interface HGSearchResult<HGHandle>
Returns:
The current element in a HGSearchResult.

isOrdered

public boolean isOrdered()
Description copied from interface: HGSearchResult

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

Specified by:
isOrdered in interface HGSearchResult<HGHandle>

hasPrev

public boolean hasPrev()
Description copied from interface: TwoWayIterator

Return true if there is a previous element in the current iteration state and false otherwise. After the iterator has been initialized, the value of hasPrev will always be false.

Specified by:
hasPrev in interface TwoWayIterator<HGHandle>

prev

public HGHandle prev()
Description copied from interface: TwoWayIterator

Returns the previous element in this iteration.

Specified by:
prev in interface TwoWayIterator<HGHandle>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<HGHandle>

next

public HGHandle next()
Specified by:
next in interface java.util.Iterator<HGHandle>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<HGHandle>