|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.DefaultObjectIterator
public class DefaultObjectIterator
ObjectIterator implementation that wraps around an ordinary Iterator.
Constructor Summary | |
---|---|
DefaultObjectIterator(java.util.Iterator iter)
Creates an ObjectIterator that behaves just like the given iterator. |
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. |
boolean |
hasNext()
|
java.lang.Object |
next()
|
void |
remove()
|
int |
skipIndistinguishable()
Skips remaining objects that are indistinguishable from the object returned by the last call to next . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultObjectIterator(java.util.Iterator iter)
canDetermineNext
method always returns true, and
its skipIndistinguishable
method always returns zero.
Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
public int skipIndistinguishable()
ObjectIterator
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.
skipIndistinguishable
in interface ObjectIterator
public boolean canDetermineNext()
ObjectIterator
hasNext
is called when canDetermineNext
would return false,
then hasNext
returns false.
canDetermineNext
in interface ObjectIterator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |