|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - The type of the elements which are stored at positions.@Revision(value="$Revision: 1.5 $",
date="$Date: 2006/11/09 02:10:05 $",
tag="$Name: $")
public interface ImmutableIterable<T>
TODO: Javadoc
This interface includes all of the methods needed to check the size of, and
handle positions. Please see rcf.core.util.iterator for a discussion
of the fact that this interface contains no methods for starting an iteration.
Note that the return values from the summary methods isEmpty() and
size() are only valid at the time of the method call, and they may
change during the iteration.
TODO: Javadoc review, Seal/Finalize
| Method Summary | |
|---|---|
boolean |
isCompatible(ImmutablePosition<T> p)
TODO: Javadoc Determine if the specified position is compatible to, i.e. |
boolean |
isEmpty()
TODO: Javadoc Return true if this iterable contains no elements. |
boolean |
isNative(ImmutablePosition<T> p)
TODO: Javadoc Determine if the specified position is native to, i.e. |
ImmutableIterator<T> |
makeNative(ImmutablePosition<T> p)
TODO: Javadoc Convert the specified position into an iterator native to this iterable. |
int |
size()
TODO: Javadoc Return the number of elements which this iterable contains. |
| Method Detail |
|---|
boolean isCompatible(ImmutablePosition<T> p)
true for
pre- and post-sentinel positions). This method should never throw
exceptions as it is a test to avoid them.
Note that this method will return true even for positions
which did not original come from this iterable, for example in the case
of an
ImmutableFixedUniIterator
over a
ImmutableCollection.subCollection(rcf.core.util.collection.position.ImmutableFixedUniPosition, rcf.core.util.filter.Filter).
To test if the specified position is native to this iterable, rather
than just compatible with it, use the
isNative(ImmutablePosition) method.
p - The position to determine if this iterable is compatible with.
true indicates that the specified position
is compatible with this iterable, and its iterators and methods.boolean isNative(ImmutablePosition<T> p)
true for pre- and post-sentinel positions). This
method should never throw exceptions as it is a test to avoid
them.
Note that this method will return false for positions
which did not original come from this iterable, for example in the case
of an
ImmutableFixedUniIterator
over a
ImmutableCollection.subCollection(rcf.core.util.collection.position.ImmutableFixedUniPosition, rcf.core.util.filter.Filter).
The positions may still be used as arguments to most methods both
on this iterable and the ImmutableIterators it creates, but
they are not native to it, and may behave differently under
iteration. To test if the specified position is compatible with
this iterable and its iterators, rather than native to it, use the
isCompatible(ImmutablePosition) method.
p - The position to determine if this iterable is native to.
true indicates that the specified position
is native to this iterable.boolean isEmpty()
true if this iterable contains no elements.
true if this iterable contains no elements.ImmutableIterator<T> makeNative(ImmutablePosition<T> p)
ImmutableIterator.copy() will be returned.
p - The position to return a native version of.
p if it is native to this
iterable, or, if isCompatible(p) a
position q such that q.equals(p)
&& isNative(q) && (q != p). Otherwise, if
!isCompatible(p), this method will
return null.int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||