|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrcf.core.util.groups.Pair.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 Pair.Iterator<A,B>
TODO: Javadoc Binds a pair of 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 Pair.Iterable<A,B> |
iterable
TODO: Javadoc |
protected rcf.core.util.collection.iterator.FixedUniIterator<A> |
x
TODO: Javadoc The first iterator which is being wrapped. |
protected rcf.core.util.collection.iterator.FixedUniIterator<B> |
y
TODO: Javadoc The second iterator which is being wrapped. |
| Constructor Summary | |
|---|---|
Pair.Iterator(Pair.Iterable<A,B> _iterable,
rcf.core.util.collection.iterator.FixedUniIterator<A> _a,
rcf.core.util.collection.iterator.FixedUniIterator<B> _b)
TODO: Javadoc Create an iterator pair from two iterator objects. |
|
| Method Summary | |
|---|---|
rcf.core.util.collection.position.ImmutableFixedUniPosition<Pair<A,B>> |
asAbstract()
|
Pair.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 |
isRemoved()
Determine if this position has been removed from the backing abstract data structure. |
boolean |
isSentinel()
Determine if this position is a sentinel; i.e. |
boolean |
isValid()
Determine if there has been a concurrent modification to the backing abstract data structure. |
Pair.Iterable<A,B> |
iterable()
TODO: Javadoc |
Pair.Iterator<A,B> |
next(rcf.core.util.filter.Filter<Pair<A,B>> filter)
|
Pair<A,B> |
remove()
Remove this position, and the element associated with it from the backing abstract data structure, and return the element. |
Pair<A,B> |
set(Pair<A,B> a)
TODO: Javadoc Set the content element of this singleton. |
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 Pair.Iterable<A,B> iterable
protected final rcf.core.util.collection.iterator.FixedUniIterator<A> x
protected final rcf.core.util.collection.iterator.FixedUniIterator<B> y
| Constructor Detail |
|---|
public Pair.Iterator(Pair.Iterable<A,B> _iterable,
rcf.core.util.collection.iterator.FixedUniIterator<A> _a,
rcf.core.util.collection.iterator.FixedUniIterator<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 Pair.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.FixedUniIterator<Pair<A,B>>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>>copy in interface Iterator<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 isRemoved()
Position
isRemoved in interface Position<Pair<A,B>>true if this position has been removed from the
backing abstract data structure.public boolean isSentinel()
ImmutablePosition
isSentinel in interface ImmutablePosition<Pair<A,B>>true if this is a sentinel position.public boolean isValid()
Positionfalse in
all cases where any method may throw a
ConcurrentModificationException.
isValid in interface Position<Pair<A,B>>true indicates that this position is still valid
(though it may have been removed, see Position.isRemoved()) in the
backing abstract data structure. This also indicates that no
method on this object will throw a
ConcurrentModificationException at the time of this call.public Pair.Iterable<A,B> iterable()
ImmutableIterator
iterable in interface rcf.core.util.collection.iterator.FixedUniIterator<Pair<A,B>>iterable in interface rcf.core.util.collection.iterator.ImmutableFixedUniIterator<Pair<A,B>>iterable in interface ImmutableIterator<Pair<A,B>>public Pair.Iterator<A,B> next(rcf.core.util.filter.Filter<Pair<A,B>> filter)
next in interface rcf.core.util.collection.iterator.FixedUniIterator<Pair<A,B>>next in interface rcf.core.util.collection.iterator.ImmutableFixedUniIterator<Pair<A,B>>public Pair<A,B> remove()
Position
remove in interface Position<Pair<A,B>>ImmutableSingletonInterface.get()public Pair<A,B> set(Pair<A,B> a)
SingletonInterface
set in interface SingletonInterface<Pair<A,B>>set in interface Position<Pair<A,B>>a - The new content element of this singleton.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||