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