blog
Interface ObjectIterator

All Superinterfaces:
java.util.Iterator
All Known Implementing Classes:
AbstractObjectIterator, DefaultObjectIterator

public interface ObjectIterator
extends java.util.Iterator

Iterator over an ObjectSet. This interface extends the Java Iterator interface in two ways:


Method Summary
 boolean canDetermineNext()
          Returns true if this ObjectIterator is running on a partial world that is complete enough to determine whether there is a next object, and if so, what that object is.
 int skipIndistinguishable()
          Skips remaining objects that are indistinguishable from the object returned by the last call to next.
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

skipIndistinguishable

int skipIndistinguishable()
Skips remaining objects that are indistinguishable from the object returned by the last call to next. Two objects are indistinguishable if the underlying partial world implies that they both satisfy the same POP application, neither one serves as a value or argument for any instantiated basic random variable, and neither one occurs in the set of "externally distinguished" objects passed to the iterator call that produced this iterator. Typically, the externally distinguished objects are the values of logical variables in the current scope.

This method can only be called immediately after a call to next: that is, there can be no intervening calls to any methods on this iterator. Even calling hasNext may cause some implementations to lose internal state that is necessary for skipping indistinguishable objects.

Returns:
the number of objects skipped (may be zero). The return value is always zero if canDetermineNext would return false.
Throws:
java.lang.IllegalStateException - if next has not been called yet, or if any other method has been called on this iterator since the last call to next

canDetermineNext

boolean canDetermineNext()
Returns true if this ObjectIterator is running on a partial world that is complete enough to determine whether there is a next object, and if so, what that object is. If hasNext is called when canDetermineNext would return false, then hasNext returns false.