|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.util.Iterators
public class Iterators
Facade for the Algorithms adapted from STL, defined to work primarily with iterators. These algorithms are adapted from STL, with modifications to be consistent with typical java practice. For example, typical STL algorithms are defined with pairs of iterators defining a half-open range over some implied collection. It works in C++ because the STL iterators can be compared for equality. Java iterators are not guaranteed to be comparable to each other by contract, so the same signatures wouldn't work.
Typically, where an STL algorithm would take a pair of iterators, this facade will take a single iterator and where an STL algorithm would return an iterator, we'll return an iterator. In this facade, the iterator returned will frequently be specialized in some way: either a ListIterator or one of the iterators defined in jga.
It is best to assume that all of the methods in this class may (but are not guaranteed to) advance the iterator argument. Also, once an iterator has been passed to one of the methods of this class, it should not be used again. On the other hand, unless otherwise noted, it is safe to pass the iterator returned by one of the methods in this class back to the method that returned it, or to any of the other methods.
Copyright © 2003-2005 David A. Hall
Constructor Summary | |
---|---|
Iterators()
Deprecated. |
Method Summary | ||
---|---|---|
static
|
equal(java.util.Iterator<? extends T> iterator1,
java.util.Iterator<? extends T> iterator2)
Deprecated. use Compare.equal(Iterator,Iterator) instead |
|
static
|
equal(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2,
BinaryFunctor<T,T,java.lang.Boolean> eq)
Deprecated. use Compare.equal(Iterator,Iterator,BinaryFunctor) instead |
|
static
|
equal(java.util.Iterator<? extends T> iterator1,
java.util.Iterator<? extends T> iterator2,
java.util.Comparator<T> comp)
Deprecated. use Compare.equal(Iterator,Iterator,Comparator) instead |
|
static
|
forEach(java.util.Iterator<? extends T> it,
UnaryFunctor<T,R> fn)
Deprecated. moved to Summarize.forEach(it,fn) |
|
static
|
lessThan(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
Deprecated. use Compare.lessThan(Iterator,Iterator) instead |
|
static
|
lessThan(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2,
BinaryFunctor<T,T,java.lang.Boolean> lt)
Deprecated. use Compare.lessThan(Iterator,Iterator,BinaryFunctor) instead |
|
static
|
lessThan(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2,
java.util.Comparator<T> comp)
Deprecated. use Compare.lessThan(Iterator,Iterator,Comparator) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Iterators()
Method Detail |
---|
public static <T,R> UnaryFunctor<T,R> forEach(java.util.Iterator<? extends T> it, UnaryFunctor<T,R> fn)
Summarize.forEach(it,fn)
public static <T extends java.lang.Comparable<? super T>> boolean equal(java.util.Iterator<? extends T> iterator1, java.util.Iterator<? extends T> iterator2)
public static <T> boolean equal(java.util.Iterator<? extends T> iterator1, java.util.Iterator<? extends T> iterator2, java.util.Comparator<T> comp)
public static <T> boolean equal(java.util.Iterator<? extends T> iter1, java.util.Iterator<? extends T> iter2, BinaryFunctor<T,T,java.lang.Boolean> eq)
public static <T extends java.lang.Comparable<? super T>> boolean lessThan(java.util.Iterator<? extends T> iter1, java.util.Iterator<? extends T> iter2)
public static <T> boolean lessThan(java.util.Iterator<? extends T> iter1, java.util.Iterator<? extends T> iter2, java.util.Comparator<T> comp)
public static <T> boolean lessThan(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2, BinaryFunctor<T,T,java.lang.Boolean> lt)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |