|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrcf.core.util.groups.ImmutableSingleton.Iterator<A>
A - The type of the content element in each singleton.public static class ImmutableSingleton.Iterator<A>
TODO: Javadoc Wrap a single immutable iterator, create an immutable iterator over singletons of elements.
| Field Summary | |
|---|---|
protected Singleton<A> |
curr
TODO: Javadoc The current singleton created from the wrapped iterator. |
protected ImmutableSingleton.Iterable<A> |
iterable
TODO: Javadoc |
protected rcf.core.util.collection.iterator.ImmutableFixedUniIterator<A> |
x
TODO: Javadoc The immutable iterator which is being wrapped. |
| Constructor Summary | |
|---|---|
ImmutableSingleton.Iterator(ImmutableSingleton.Iterable<A> _iterable,
rcf.core.util.collection.iterator.ImmutableFixedUniIterator<A> _a)
TODO: Javadoc Create an immutable iterator of singletons from an immutable iterable object. |
|
| Method Summary | |
|---|---|
rcf.core.util.collection.position.ImmutableFixedUniPosition<Singleton<A>> |
asAbstract()
|
ImmutableSingleton.Iterator<A> |
copy()
TODO: Javadoc Return a new iterator which is currently at the same position as this iterator. |
boolean |
equals(Object o)
Determine if the specified object is an instance of ImmutablPposition which represents the same position in the
same abstract data structure, as this object. |
Singleton<A> |
get()
TODO: Javadoc Get the content element of this singleton. |
int |
hashCode()
|
boolean |
isCompatible(ImmutablePosition<Singleton<A>> p)
Determine if this position is compatible to, i.e. |
boolean |
isPost()
|
boolean |
isPre()
|
boolean |
isSentinel()
Determine if this position is a sentinel; i.e. |
ImmutableSingleton.Iterable<A> |
iterable()
TODO: Javadoc |
ImmutableSingleton.Iterator<A> |
next(rcf.core.util.filter.Filter<Singleton<A>> filter)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Singleton<A> curr
protected final ImmutableSingleton.Iterable<A> iterable
protected final rcf.core.util.collection.iterator.ImmutableFixedUniIterator<A> x
| Constructor Detail |
|---|
public ImmutableSingleton.Iterator(ImmutableSingleton.Iterable<A> _iterable,
rcf.core.util.collection.iterator.ImmutableFixedUniIterator<A> _a)
_iterable - _a - The iterator object which is to be wrapped and iterated.| Method Detail |
|---|
public rcf.core.util.collection.position.ImmutableFixedUniPosition<Singleton<A>> asAbstract()
asAbstract in interface rcf.core.util.collection.position.ImmutableFixedUniPosition<Singleton<A>>public ImmutableSingleton.Iterator<A> copy()
ImmutableIteratorthis iterator. That is, this method will return an iterator
i such that this.equals(i) && this.isCompatible(i)
(notice that equals is symmetric but isCompatible is not). Note that a call to
e.g. ImmutableFixedUniIterator.next(rcf.core.util.filter.Filter)
on this must not affect i and vice-versa.This method is extremely useful in conjunction with position based collections where iteration is expensive or positions have algorithmic importance or higher level semantics.
copy in interface rcf.core.util.collection.iterator.ImmutableFixedUniIterator<Singleton<A>>copy in interface rcf.core.util.Copyablecopy in interface ImmutableIterator<Singleton<A>>i such that
this.equals(i).public boolean equals(Object o)
ImmutablePositionImmutablPposition which represents the same position in the
same abstract data structure, as this object. Notice that for positions
p and q, p.equals(q) implies
p.isCompatible(q) && q.isCompatible(p).
equals in interface ImmutablePosition<Singleton<A>>equals in class Objecto - The object to compare this one to, for equality.
true if this position and the one specified
represent the same position, in the same abstract data structure.public Singleton<A> get()
ImmutableSingletonInterface
get in interface ImmutableSingletonInterface<Singleton<A>>public int hashCode()
hashCode in class Objectpublic boolean isCompatible(ImmutablePosition<Singleton<A>> p)
ImmutablePositiontrue even for sentinel positions). This method should never
throw exceptions (especially IncompatiblePositionException) as it
is a test to avoid them.
isCompatible in interface ImmutablePosition<Singleton<A>>p - The position to determine if this one is compatible to.
true indicates that this position and the specified
one belong to the same abstract data structure.public boolean isPost()
isPost in interface rcf.core.util.collection.position.ImmutableFixedUniPosition<Singleton<A>>public boolean isPre()
isPre in interface rcf.core.util.collection.position.ImmutableFixedUniPosition<Singleton<A>>public boolean isSentinel()
ImmutablePosition
isSentinel in interface ImmutablePosition<Singleton<A>>true if this is a sentinel position.public ImmutableSingleton.Iterable<A> iterable()
ImmutableIterator
iterable in interface rcf.core.util.collection.iterator.ImmutableFixedUniIterator<Singleton<A>>iterable in interface ImmutableIterator<Singleton<A>>public ImmutableSingleton.Iterator<A> next(rcf.core.util.filter.Filter<Singleton<A>> filter)
next in interface rcf.core.util.collection.iterator.ImmutableFixedUniIterator<Singleton<A>>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||