|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrcf.core.util.groups.ImmutablePair.Iterator<A,B>
A - The type of the first entry in each pair.B - The type of the second entry in each pair.public static class ImmutablePair.Iterator<A,B>
TODO: Javadoc Binds a pair of immutable iterators, allowing them to be iterated in tandem.
| Field Summary | |
|---|---|
protected Pair<A,B> |
curr
TODO: Javadoc The current pair created from the wrapped iterators. |
protected ImmutablePair.Iterable<A,B> |
iterable
TODO: Javadoc |
protected rcf.core.util.collection.iterator.ImmutableFixedUniIterator<A> |
x
TODO: Javadoc The first immutable iterator which is being wrapped. |
protected rcf.core.util.collection.iterator.ImmutableFixedUniIterator<B> |
y
TODO: Javadoc The second immutable iterator which is being wrapped. |
| Constructor Summary | |
|---|---|
ImmutablePair.Iterator(ImmutablePair.Iterable<A,B> _iterable,
rcf.core.util.collection.iterator.ImmutableFixedUniIterator<A> _a,
rcf.core.util.collection.iterator.ImmutableFixedUniIterator<B> _b)
TODO: Javadoc Create an immutable iterator pair from two immutable iterable objects. |
|
| Method Summary | |
|---|---|
rcf.core.util.collection.position.ImmutableFixedUniPosition<Pair<A,B>> |
asAbstract()
|
ImmutablePair.Iterator<A,B> |
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. |
Pair<A,B> |
get()
TODO: Javadoc Get the content element of this singleton. |
int |
hashCode()
|
boolean |
isCompatible(ImmutablePosition<Pair<A,B>> 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. |
ImmutablePair.Iterable<A,B> |
iterable()
TODO: Javadoc |
ImmutablePair.Iterator<A,B> |
next(rcf.core.util.filter.Filter<Pair<A,B>> filter)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Pair<A,B> curr
protected final ImmutablePair.Iterable<A,B> iterable
protected final rcf.core.util.collection.iterator.ImmutableFixedUniIterator<A> x
protected final rcf.core.util.collection.iterator.ImmutableFixedUniIterator<B> y
| Constructor Detail |
|---|
public ImmutablePair.Iterator(ImmutablePair.Iterable<A,B> _iterable,
rcf.core.util.collection.iterator.ImmutableFixedUniIterator<A> _a,
rcf.core.util.collection.iterator.ImmutableFixedUniIterator<B> _b)
_iterable - _a - The A type iterator object._b - The B type iterator object.| Method Detail |
|---|
public rcf.core.util.collection.position.ImmutableFixedUniPosition<Pair<A,B>> asAbstract()
asAbstract in interface rcf.core.util.collection.position.ImmutableFixedUniPosition<Pair<A,B>>public ImmutablePair.Iterator<A,B> 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<Pair<A,B>>copy in interface rcf.core.util.Copyablecopy in interface ImmutableIterator<Pair<A,B>>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<Pair<A,B>>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 Pair<A,B> get()
ImmutableSingletonInterface
get in interface ImmutableSingletonInterface<Pair<A,B>>public int hashCode()
hashCode in class Objectpublic boolean isCompatible(ImmutablePosition<Pair<A,B>> 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<Pair<A,B>>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<Pair<A,B>>public boolean isPre()
isPre in interface rcf.core.util.collection.position.ImmutableFixedUniPosition<Pair<A,B>>public boolean isSentinel()
ImmutablePosition
isSentinel in interface ImmutablePosition<Pair<A,B>>true if this is a sentinel position.public ImmutablePair.Iterable<A,B> iterable()
ImmutableIterator
iterable in interface rcf.core.util.collection.iterator.ImmutableFixedUniIterator<Pair<A,B>>iterable in interface ImmutableIterator<Pair<A,B>>public ImmutablePair.Iterator<A,B> next(rcf.core.util.filter.Filter<Pair<A,B>> filter)
next in interface rcf.core.util.collection.iterator.ImmutableFixedUniIterator<Pair<A,B>>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||