|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.co.jezuk.mango.Algorithms
public class Algorithms
The Mango Library Algorithms
| Method Summary | ||
|---|---|---|
static
|
count(java.util.Collection<? extends T> collection,
int start,
int end,
T value)
|
|
static
|
count(java.util.Collection<? extends T> collection,
T value)
Count computes the number of elements in the sequence that
are equal to value. |
|
static
|
count(java.util.Iterator<? extends T> iterator,
T value)
|
|
static
|
count(java.util.List<? extends T> list,
int start,
int end,
T value)
|
|
static
|
countIf(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> test)
|
|
static
|
countIf(java.util.Collection<T> collection,
Predicate<? super T> test)
CountIf is similar to Count, but more general. |
|
static
|
countIf(java.util.Iterator<T> iterator,
Predicate<? super T> test)
|
|
static
|
countIf(java.util.List<T> list,
int start,
int end,
Predicate<? super T> test)
|
|
static
|
countIfNot(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> test)
|
|
static
|
countIfNot(java.util.Collection<T> collection,
Predicate<? super T> test)
CountIfNot is the complement of CountIf. |
|
static
|
countIfNot(java.util.Iterator<T> iterator,
Predicate<? super T> test)
|
|
static
|
countIfNot(java.util.List<T> list,
int start,
int end,
Predicate<? super T> test)
|
|
static
|
find(java.util.Collection<? extends T> collection,
int start,
int end,
T value)
|
|
static
|
find(java.util.Collection<? extends T> collection,
T value)
Searchs the sequence travesed by the Iterator for the given value. |
|
static
|
find(java.util.Iterator<? extends T> iterator,
T value)
|
|
static
|
find(java.util.List<? extends T> list,
int start,
int end,
T value)
|
|
static
|
findIf(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> test)
|
|
static
|
findIf(java.util.Collection<T> collection,
Predicate<? super T> test)
Searchs the sequence traversed by the Iterator and returns the first object encountered for which the Predicate returns true. |
|
static
|
findIf(java.util.Iterator<T> iterator,
Predicate<? super T> test)
|
|
static
|
findIf(java.util.List<T> list,
int start,
int end,
Predicate<? super T> test)
|
|
static
|
findIfNot(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> test)
|
|
static
|
findIfNot(java.util.Collection<T> collection,
Predicate<? super T> test)
Searchs the sequence traversed by the Iterator and returns the first object encountered for which the Predicate returns false. |
|
static
|
findIfNot(java.util.Iterator<T> iterator,
Predicate<? super T> test)
|
|
static
|
findIfNot(java.util.List<T> list,
int start,
int end,
Predicate<? super T> test)
|
|
static
|
findPosition(java.util.Collection<? extends T> collection,
int start,
int end,
T value)
|
|
static
|
findPosition(java.util.Collection<? extends T> collection,
T value)
Searchs the sequence travesed by the Iterator for the given value. |
|
static
|
findPosition(java.util.Iterator<? extends T> iterator,
T value)
|
|
static
|
findPosition(java.util.List<? extends T> list,
int start,
int end,
T value)
|
|
static
|
findPositionIf(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> pred)
|
|
static
|
findPositionIf(java.util.Collection<T> collection,
Predicate<? super T> pred)
|
|
static
|
findPositionIf(java.util.Iterator<T> iterator,
Predicate<? super T> pred)
|
|
static
|
findPositionIf(java.util.List<T> list,
int start,
int end,
Predicate<? super T> pred)
|
|
static
|
forEach(java.util.Collection<T> collection,
Function<? super T,R> fn)
The algorithm ForEach applies the function fn to
each element in the iterator sequence. |
|
static
|
forEach(java.util.Collection<T> collection,
int start,
int end,
Function<? super T,R> fn)
|
|
static
|
forEach(java.util.Iterator<T> iterator,
Function<? super T,R> fn)
|
|
static
|
forEach(java.util.List<T> list,
int start,
int end,
Function<? super T,R> fn)
|
|
static
|
intersection(java.util.Collection<? extends T> coll1,
java.util.Collection<? extends T> coll2)
Algorithm intersection finds the common elements in both collections See http://en.wikipedia.org/wiki/Intersection_(set_theory) |
|
static
|
intersection(java.util.Collection<? extends T> coll1,
java.util.Collection<? extends T> coll2,
C results)
|
|
static
|
intersection(java.util.Iterator<? extends T> iter1,
java.util.Collection<? extends T> coll2)
|
|
static
|
intersection(java.util.Iterator<? extends T> iter1,
java.util.Collection<? extends T> coll2,
C results)
|
|
static
|
intersection(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
|
|
static
|
intersection(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2,
C results)
|
|
static
|
partition(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> pred)
|
|
static
|
partition(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> pred,
C results)
|
|
static
|
partition(java.util.Collection<T> collection,
Predicate<? super T> pred)
Partitions the supplied collections into two. |
|
static
|
partition(java.util.Collection<T> collection,
Predicate<? super T> pred,
C results)
|
|
static
|
partition(java.util.Iterator<T> iterator,
Predicate<? super T> pred)
|
|
static
|
partition(java.util.Iterator<T> iterator,
Predicate<? super T> pred,
C results)
|
|
static
|
partition(java.util.List<T> list,
int start,
int end,
Predicate<? super T> pred)
|
|
static
|
partition(java.util.List<T> list,
int start,
int end,
Predicate<? super T> pred,
C results)
|
|
static
|
remove(java.util.Collection<? extends T> collection,
int start,
int end,
T value)
|
|
static
|
remove(java.util.Collection<? extends T> collection,
T value)
Removes objects equal to value from the sequence. |
|
static
|
remove(java.util.Iterator<? extends T> iterator,
T value)
|
|
static
|
remove(java.util.List<? extends T> list,
int start,
int end,
T value)
|
|
static
|
removeIf(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> pred)
|
|
static
|
removeIf(java.util.Collection<T> collection,
Predicate<? super T> pred)
Removes objects which match test from the sequence. |
|
static
|
removeIf(java.util.Iterator<T> iterator,
Predicate<? super T> pred)
|
|
static
|
removeIf(java.util.List<T> list,
int start,
int end,
Predicate<? super T> pred)
|
|
static
|
symmetricDifference(java.util.Collection<? extends T> coll1,
java.util.Collection<? extends T> coll2)
Algorithm symmetricDifference returns the elements that are on coll1 and not in coll2, and those elements in coll2 that are not in coll1. |
|
static
|
symmetricDifference(java.util.Collection<? extends T> coll1,
java.util.Collection<? extends T> coll2,
C results)
|
|
static
|
symmetricDifference(java.util.Iterator<? extends T> iter1,
java.util.Collection<? extends T> coll2)
|
|
static
|
symmetricDifference(java.util.Iterator<? extends T> iter1,
java.util.Collection<? extends T> coll2,
C results)
|
|
static
|
symmetricDifference(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
|
|
static
|
transform(java.util.Collection<T> collection,
Function<? super T,R> fn)
The algorithm Transform applies the function fn to
each element in the iterator sequence. |
|
static
|
transform(java.util.Collection<T> collection,
Function<? super T,R> fn,
C results)
|
|
static
|
transform(java.util.Collection<T> collection,
int start,
int end,
Function<? super T,R> fn)
|
|
static
|
transform(java.util.Collection<T> collection,
int start,
int end,
Function<? super T,R> fn,
C results)
|
|
static
|
transform(java.util.Iterator<T> iterator,
Function<? super T,R> fn)
|
|
static
|
transform(java.util.Iterator<T> iterator,
Function<? super T,R> fn,
C results)
|
|
static
|
transform(java.util.List<T> collection,
int start,
int end,
Function<? super T,R> fn)
|
|
static
|
transform(java.util.List<T> list,
int start,
int end,
Function<? super T,R> fn,
C results)
|
|
static
|
unique(java.util.Collection<T> collection)
Removes duplicate elements. |
|
static
|
unique(java.util.Collection<T> collection,
java.util.Comparator<? super T> comparator)
|
|
static
|
unique(java.util.Collection<T> collection,
int start,
int end)
|
|
static
|
unique(java.util.Collection<T> collection,
int start,
int end,
java.util.Comparator<? super T> comparator)
|
|
static
|
unique(java.util.Iterator<T> iterator)
|
|
static
|
unique(java.util.Iterator<T> iterator,
java.util.Comparator<? super T> comparator)
|
|
static
|
unique(java.util.List<T> list,
int start,
int end)
|
|
static
|
unique(java.util.List<T> list,
int start,
int end,
java.util.Comparator<? super T> comparator)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> java.util.List<T> intersection(java.util.Collection<? extends T> coll1,
java.util.Collection<? extends T> coll2)
public static <T,C extends java.util.Collection<? super T>> C intersection(java.util.Collection<? extends T> coll1,
java.util.Collection<? extends T> coll2,
C results)
public static <T> java.util.List<T> intersection(java.util.Iterator<? extends T> iter1,
java.util.Collection<? extends T> coll2)
public static <T,C extends java.util.Collection<? super T>> C intersection(java.util.Iterator<? extends T> iter1,
java.util.Collection<? extends T> coll2,
C results)
public static <T> java.util.List<T> intersection(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
public static <T,C extends java.util.Collection<? super T>> C intersection(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2,
C results)
public static <T> java.util.List<T> symmetricDifference(java.util.Collection<? extends T> coll1,
java.util.Collection<? extends T> coll2)
public static <T,C extends java.util.Collection<? super T>> C symmetricDifference(java.util.Collection<? extends T> coll1,
java.util.Collection<? extends T> coll2,
C results)
public static <T> java.util.List<T> symmetricDifference(java.util.Iterator<? extends T> iter1,
java.util.Collection<? extends T> coll2)
public static <T,C extends java.util.Collection<? super T>> C symmetricDifference(java.util.Iterator<? extends T> iter1,
java.util.Collection<? extends T> coll2,
C results)
public static <T> java.util.List<T> symmetricDifference(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
public static <T,R> void forEach(java.util.Collection<T> collection,
Function<? super T,R> fn)
fn to
each element in the iterator sequence.
public static <T,R> void forEach(java.util.Collection<T> collection,
int start,
int end,
Function<? super T,R> fn)
public static <T,R> void forEach(java.util.List<T> list,
int start,
int end,
Function<? super T,R> fn)
public static <T,R> void forEach(java.util.Iterator<T> iterator,
Function<? super T,R> fn)
public static <T,R> java.util.List<R> transform(java.util.Collection<T> collection,
Function<? super T,R> fn)
fn to
each element in the iterator sequence.
The return value of fn is added to the results
collection. If the return value of fn is itself a
collection, then each member of that collection is added to
results.
public static <T,R,C extends java.util.Collection<? super R>> C transform(java.util.Collection<T> collection,
Function<? super T,R> fn,
C results)
public static <T,R> java.util.List<R> transform(java.util.Collection<T> collection,
int start,
int end,
Function<? super T,R> fn)
public static <T,R,C extends java.util.Collection<? super R>> C transform(java.util.Collection<T> collection,
int start,
int end,
Function<? super T,R> fn,
C results)
public static <T,R> java.util.List<R> transform(java.util.List<T> collection,
int start,
int end,
Function<? super T,R> fn)
public static <T,R,C extends java.util.Collection<? super R>> C transform(java.util.List<T> list,
int start,
int end,
Function<? super T,R> fn,
C results)
public static <T,R> java.util.List<R> transform(java.util.Iterator<T> iterator,
Function<? super T,R> fn)
public static <T,R,C extends java.util.Collection<? super R>> C transform(java.util.Iterator<T> iterator,
Function<? super T,R> fn,
C results)
public static <T> int count(java.util.Collection<? extends T> collection,
T value)
Count computes the number of elements in the sequence that
are equal to value. value may be null.value must be comparable using
Object.equals (unless value is null).
public static <T> int count(java.util.Collection<? extends T> collection,
int start,
int end,
T value)
public static <T> int count(java.util.List<? extends T> list,
int start,
int end,
T value)
public static <T> int count(java.util.Iterator<? extends T> iterator,
T value)
public static <T> int countIf(java.util.Collection<T> collection,
Predicate<? super T> test)
CountIf is similar to Count, but more general.
It computes the number of elements in the sequence which satisfy some condition.
The condition is a described in the user-supplied test object, and
CountIf computes the number of objects such that test.test(o)
is true.
public static <T> int countIf(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> test)
public static <T> int countIf(java.util.List<T> list,
int start,
int end,
Predicate<? super T> test)
public static <T> int countIf(java.util.Iterator<T> iterator,
Predicate<? super T> test)
public static <T> int countIfNot(java.util.Collection<T> collection,
Predicate<? super T> test)
CountIfNot is the complement of CountIf.
It counts the number of elements in the sequence which fail some condition.
The condition is a described in the user-supplied test object, and
CountIfNot computes the number of objects such that test.test(o)
is false.
public static <T> int countIfNot(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> test)
public static <T> int countIfNot(java.util.List<T> list,
int start,
int end,
Predicate<? super T> test)
public static <T> int countIfNot(java.util.Iterator<T> iterator,
Predicate<? super T> test)
public static <T> T find(java.util.Collection<? extends T> collection,
T value)
Object, or null if the value
is not found. The iterator will have been advanced to the next object
in the sequence.
The objects in the sequence and value must be comparable using
Object.equals (unless value is null).
public static <T> T find(java.util.Collection<? extends T> collection,
int start,
int end,
T value)
public static <T> T find(java.util.List<? extends T> list,
int start,
int end,
T value)
public static <T> T find(java.util.Iterator<? extends T> iterator,
T value)
public static <T> int findPosition(java.util.Collection<? extends T> collection,
T value)
-1
if the value is not found. The iterator will have been advanced to
the next object in the sequence.
The objects in the sequence and value must be comparable using
Object.equals (unless value is null).
public static <T> int findPosition(java.util.Collection<? extends T> collection,
int start,
int end,
T value)
public static <T> int findPosition(java.util.List<? extends T> list,
int start,
int end,
T value)
public static <T> int findPosition(java.util.Iterator<? extends T> iterator,
T value)
public static <T> int findPositionIf(java.util.Collection<T> collection,
Predicate<? super T> pred)
public static <T> int findPositionIf(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> pred)
public static <T> int findPositionIf(java.util.List<T> list,
int start,
int end,
Predicate<? super T> pred)
public static <T> int findPositionIf(java.util.Iterator<T> iterator,
Predicate<? super T> pred)
public static <T> T findIf(java.util.Collection<T> collection,
Predicate<? super T> test)
true.
Returns the Object, or null if the value
is not found. The iterator will have been advanced to the next object
in the sequence.
public static <T> T findIf(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> test)
public static <T> T findIf(java.util.List<T> list,
int start,
int end,
Predicate<? super T> test)
public static <T> T findIf(java.util.Iterator<T> iterator,
Predicate<? super T> test)
public static <T> T findIfNot(java.util.Collection<T> collection,
Predicate<? super T> test)
false.
The iterator will have been advanced to the next object
in the sequence.
public static <T> T findIfNot(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> test)
public static <T> T findIfNot(java.util.List<T> list,
int start,
int end,
Predicate<? super T> test)
public static <T> T findIfNot(java.util.Iterator<T> iterator,
Predicate<? super T> test)
public static <T> void remove(java.util.Collection<? extends T> collection,
T value)
value from the sequence.
public static <T> void remove(java.util.Collection<? extends T> collection,
int start,
int end,
T value)
public static <T> void remove(java.util.List<? extends T> list,
int start,
int end,
T value)
public static <T> void remove(java.util.Iterator<? extends T> iterator,
T value)
public static <T> void removeIf(java.util.Collection<T> collection,
Predicate<? super T> pred)
test from the sequence.
public static <T> void removeIf(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> pred)
public static <T> void removeIf(java.util.List<T> list,
int start,
int end,
Predicate<? super T> pred)
public static <T> void removeIf(java.util.Iterator<T> iterator,
Predicate<? super T> pred)
public static <T> java.util.List<T> partition(java.util.Collection<T> collection,
Predicate<? super T> pred)
public static <T,C extends java.util.Collection<? super T>> C partition(java.util.Collection<T> collection,
Predicate<? super T> pred,
C results)
public static <T> java.util.List<T> partition(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> pred)
public static <T,C extends java.util.Collection<? super T>> C partition(java.util.Collection<T> collection,
int start,
int end,
Predicate<? super T> pred,
C results)
public static <T> java.util.List<T> partition(java.util.List<T> list,
int start,
int end,
Predicate<? super T> pred)
public static <T,C extends java.util.Collection<? super T>> C partition(java.util.List<T> list,
int start,
int end,
Predicate<? super T> pred,
C results)
public static <T> java.util.List<T> partition(java.util.Iterator<T> iterator,
Predicate<? super T> pred)
public static <T,C extends java.util.Collection<? super T>> C partition(java.util.Iterator<T> iterator,
Predicate<? super T> pred,
C results)
public static <T> void unique(java.util.Collection<T> collection)
unique removes all but the first objects
in each group.
iterator must support the remove method.
Iterator,
Comparator
public static <T> void unique(java.util.Collection<T> collection,
int start,
int end)
public static <T> void unique(java.util.List<T> list,
int start,
int end)
public static <T> void unique(java.util.Iterator<T> iterator)
public static <T> void unique(java.util.Collection<T> collection,
java.util.Comparator<? super T> comparator)
public static <T> void unique(java.util.Collection<T> collection,
int start,
int end,
java.util.Comparator<? super T> comparator)
public static <T> void unique(java.util.List<T> list,
int start,
int end,
java.util.Comparator<? super T> comparator)
public static <T> void unique(java.util.Iterator<T> iterator,
java.util.Comparator<? super T> comparator)
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||