|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--xxl.cursors.Cursors
This class contains various methods for manipulating Iterators.
| Constructor Summary | |
Cursors()
|
|
| Method Summary | |
static boolean |
all(java.util.Iterator[] iterators,
Function function)
Returns true iff function returns Boolean.TRUE for each vector of elements of iterators while all iterators are not empty. |
static boolean |
all(java.util.Iterator iterator,
Function function)
Returns true iff function returns Boolean.TRUE for each element of iterator. |
static boolean |
all(java.util.Iterator iterator1,
java.util.Iterator iterator2,
Function function)
Returns true iff function returns Boolean.TRUE for each pair of elements of iterator1 and iterator2 while both iterators are not empty. |
static boolean |
any(java.util.Iterator[] iterators,
Function function)
Returns true iff function returns Boolean.TRUE for any vector of elements of iterators while all iterators are not empty. |
static boolean |
any(java.util.Iterator iterator,
Function function)
Returns true iff function returns Boolean.TRUE for any element of iterator. |
static boolean |
any(java.util.Iterator iterator1,
java.util.Iterator iterator2,
Function function)
Returns true iff function returns Boolean.TRUE for any pair of elements of iterator1 and iterator2 while both iterators are not empty. |
static int |
count(java.util.Iterator iterator)
Counts the elements of a specified Iterator. |
static java.lang.Object |
first(java.util.Iterator iterator)
Returns the first element of an Iterator. |
static void |
forEach(java.util.Iterator[] iterators,
Function function)
Invokes function for each vector of elements of iterators while all iterators are not empty. |
static void |
forEach(java.util.Iterator iterator,
Function function)
Invokes function for each element of the iterator. |
static void |
forEach(java.util.Iterator iterator1,
java.util.Iterator iterator2,
Function function)
Invokes function for each pair of elements of iterator1 and iterator2 while both iterators are not empty. |
static java.lang.Object |
last(java.util.Iterator iterator)
Returns the last element of an Iterator. |
static java.util.LinkedList |
minima(java.util.Iterator iterator)
Returns the list of objects equal to the minimal value in the same order provided by the iterator as its value using a ComparableComparator. |
static java.util.LinkedList |
minima(java.util.Iterator iterator,
java.util.Comparator comparator)
Returns the list of objects equal to the minimal value in the same order provided by the iterator as its value. |
static java.util.LinkedList |
minima(java.util.Iterator iterator,
Function getFeature)
Returns the list of objects having the minimal value in the same order provided by the iterator using a ComparableComparator. |
static java.util.LinkedList |
minima(java.util.Iterator iterator,
Function getFeature,
java.util.Comparator comparator)
Returns the list of objects having the minimal value in the same order provided by the iterator. |
static java.util.Map.Entry |
minimize(java.util.Iterator iterator)
Returns a Map.Entry-object with the minimal value as its key and the list of objects equal to the minimal value in the same order provided by the iterator as its value using a ComparableComparator. |
static java.util.Map.Entry |
minimize(java.util.Iterator iterator,
java.util.Comparator comparator)
Returns a Map.Entry-object with the minimal value as its key and the list of objects equal to the minimal value in the same order provided by the iterator as its value. |
static java.util.Map.Entry |
minimize(java.util.Iterator iterator,
Function getFeature)
Returns a Map.Entry-object with the minimal value as its key and the list of objects having this minimal value in the same order provided by the iterator as its value using a ComparableComparator. |
static java.util.Map.Entry |
minimize(java.util.Iterator iterator,
Function getFeature,
java.util.Comparator comparator)
Returns a Map.Entry-object with the minimal value as its key and the list of objects having this minimal value in the same order provided by the iterator as its value. |
static java.lang.Object |
nth(java.util.Iterator iterator,
int n)
Returns the n-th element of an Iterator. |
static void |
removeAll(java.util.Iterator iterator)
Removes all elements of an Iterator. |
static java.lang.Object[] |
toArray(java.util.Iterator iterator)
Converts an Iterator to an Array whose length is equal to the number of the Iterator-elements. |
static java.lang.Object[] |
toArray(java.util.Iterator iterator,
java.util.Iterator indices)
Converts an Iterator to an Array whose length is determined by the largest index. |
static java.lang.Object[] |
toArray(java.util.Iterator iterator,
java.lang.Object[] array)
Converts an Iterator to an Array. |
static java.lang.Object[] |
toArray(java.util.Iterator iterator,
java.lang.Object[] array,
java.util.Iterator indices)
Converts an Iterator to an Array. |
static java.util.Collection |
toCollection(java.util.Iterator iterator,
java.util.Collection collection)
Adds the elements of an Iterator to a given Collection. |
static java.util.List |
toList(java.util.Iterator iterator)
Converts an Iterator to a List. |
static java.util.List |
toList(java.util.Iterator iterator,
java.util.List list)
Converts an Iterator to a List. |
static java.util.Map |
toMap(java.util.Iterator iterator,
Function getKey)
Converts an Iterator to a HashMap. |
static java.util.Map |
toMap(java.util.Iterator iterator,
Function getKey,
Function newCollection)
Converts an Iterator to a HashMap. |
static java.util.Map |
toMap(java.util.Iterator iterator,
Function getKey,
java.util.Map map)
Converts an Iterator to a Map. |
static java.util.Map |
toMap(java.util.Iterator iterator,
Function getKey,
java.util.Map map,
Function newCollection)
Converts an Iterator to a Map. |
static void |
updateAll(Cursor cursor,
Function function)
Updates all elements of a Cursor with the result of a given Function. |
static void |
updateAll(Cursor cursor,
java.util.Iterator objects)
Updates all elements of a Cursor. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Cursors()
| Method Detail |
public static void forEach(java.util.Iterator iterator,
Function function)
public static void forEach(java.util.Iterator iterator1,
java.util.Iterator iterator2,
Function function)
public static void forEach(java.util.Iterator[] iterators,
Function function)
public static boolean all(java.util.Iterator iterator,
Function function)
public static boolean all(java.util.Iterator iterator1,
java.util.Iterator iterator2,
Function function)
public static boolean all(java.util.Iterator[] iterators,
Function function)
public static boolean any(java.util.Iterator iterator,
Function function)
public static boolean any(java.util.Iterator iterator1,
java.util.Iterator iterator2,
Function function)
public static boolean any(java.util.Iterator[] iterators,
Function function)
public static java.lang.Object last(java.util.Iterator iterator)
throws java.util.NoSuchElementException
iterator - input-Iterator
public static java.lang.Object nth(java.util.Iterator iterator,
int n)
throws java.util.NoSuchElementException
iterator - input-Iteratorn - index of the element
public static java.lang.Object first(java.util.Iterator iterator)
throws java.util.NoSuchElementException
iterator - input-Iteratorthe - first elementpublic static int count(java.util.Iterator iterator)
iterator - input-Iterator
public static java.util.Map.Entry minimize(java.util.Iterator iterator,
Function getFeature,
java.util.Comparator comparator)
iterator - the objects to be minimizedgetFeature - the function obtaining the value for each object used to comparecomparator - the comparator that compares the values obtained by getFeature
public static java.util.LinkedList minima(java.util.Iterator iterator,
Function getFeature,
java.util.Comparator comparator)
iterator - the objects to be minimizedgetFeature - the function obtaining the value for each object used to comparecomparator - the comparator that compares the values obtained by getFeature
public static java.util.Map.Entry minimize(java.util.Iterator iterator,
Function getFeature)
iterator - the objects to be minimizedgetFeature - the function obtaining the value for each object used to compare
public static java.util.LinkedList minima(java.util.Iterator iterator,
Function getFeature)
iterator - the objects to be minimizedgetFeature - the function obtaining the value for each object used to compare
public static java.util.Map.Entry minimize(java.util.Iterator iterator,
java.util.Comparator comparator)
iterator - the objects to be minimizedcomparator - the comparator that compares the objects
public static java.util.LinkedList minima(java.util.Iterator iterator,
java.util.Comparator comparator)
iterator - the objects to be minimizedcomparator - the comparator that compares the objectspublic static java.util.Map.Entry minimize(java.util.Iterator iterator)
iterator - the objects to be minimizedpublic static java.util.LinkedList minima(java.util.Iterator iterator)
iterator - the objects to be minimizedpublic static void removeAll(java.util.Iterator iterator)
iterator - input-Iterator
public static void updateAll(Cursor cursor,
java.util.Iterator objects)
cursor - input-Cursoriterator - the Iterator with objects to be used for the
update-operation
public static void updateAll(Cursor cursor,
Function function)
cursor - input-Cursorfunction - the Function used to compute the Object for
the update-operation
public static java.util.Collection toCollection(java.util.Iterator iterator,
java.util.Collection collection)
iterator - input-Iteratorcollection - the Collection to which the elements are to be
added
public static java.util.List toList(java.util.Iterator iterator,
java.util.List list)
iterator - input-Iteratorlist - the list to which the elements are to be addedpublic static java.util.List toList(java.util.Iterator iterator)
iterator - input-Iteratorpublic static java.lang.Object[] toArray(java.util.Iterator iterator)
iterator - input-Iterator
public static java.lang.Object[] toArray(java.util.Iterator iterator,
java.util.Iterator indices)
iterator - input-Iteratorindices - each index determines where to store the corresponding Iterator-element.
public static java.lang.Object[] toArray(java.util.Iterator iterator,
java.lang.Object[] array,
java.util.Iterator indices)
iterator - input-Iteratorarray - the array to be filledindices - each index determines where to store the corresponding Iterator-element.
public static java.lang.Object[] toArray(java.util.Iterator iterator,
java.lang.Object[] array)
iterator - input-Iteratorarray - the array to be filled
public static java.util.Map toMap(java.util.Iterator iterator,
Function getKey,
java.util.Map map,
Function newCollection)
iterator - input-IteratorgetKey - function that determines for an Iterator-element its keymap - the map used to store the partitionsnewCollection - creates a new collection to store the elements of a new partition
public static java.util.Map toMap(java.util.Iterator iterator,
Function getKey,
java.util.Map map)
iterator - input-IteratorgetKey - function that determines for an Iterator-element its keymap - the map used to store the partitions
public static java.util.Map toMap(java.util.Iterator iterator,
Function getKey,
Function newCollection)
iterator - input-IteratorgetKey - function that determines for an Iterator-element its keynewCollection - creates a new collection to store the elements of a new partition
public static java.util.Map toMap(java.util.Iterator iterator,
Function getKey)
iterator - input-IteratorgetKey - function that determines for an Iterator-element its key
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||