| Package | Description |
|---|---|
| org.eclipse.xtext.xbase.lib | |
| org.eclipse.xtext.xbase.lib.internal |
| Modifier and Type | Method and Description |
|---|---|
static <P1,P2,RESULT> |
FunctionExtensions.curry(Functions.Function2<? super P1,? super P2,? extends RESULT> function,
P1 argument)
Curries a function that takes two arguments.
|
| Modifier and Type | Method and Description |
|---|---|
static <P1,RESULT> |
FunctionExtensions.curry(Functions.Function1<? super P1,? extends RESULT> function,
P1 argument)
Curries a function that takes one argument.
|
static <T> Iterable<T> |
IterableExtensions.dropWhile(Iterable<? extends T> iterable,
Functions.Function1<? super T,Boolean> predicate)
Returns an Iterable containing all elements starting from the first element for which the drop-predicate returned
false.
|
static <T> Iterator<T> |
IteratorExtensions.dropWhile(Iterator<? extends T> iterator,
Functions.Function1<? super T,Boolean> predicate)
Returns an Iterator containing all elements starting from the first element for which the drop-predicate returned
false.
|
static <T> boolean |
IterableExtensions.exists(Iterable<T> iterable,
Functions.Function1<? super T,Boolean> predicate)
Returns
true if one or more elements in iterable satisfy the predicate. |
static <T> boolean |
IteratorExtensions.exists(Iterator<T> iterator,
Functions.Function1<? super T,Boolean> predicate)
Returns
true if one or more elements in iterator satisfy the predicate. |
static <T> Iterable<T> |
IterableExtensions.filter(Iterable<T> unfiltered,
Functions.Function1<? super T,Boolean> predicate)
Returns the elements of
unfiltered that satisfy a predicate. |
static <T> Iterator<T> |
IteratorExtensions.filter(Iterator<T> unfiltered,
Functions.Function1<? super T,Boolean> predicate)
Returns the elements of
unfiltered that satisfy a predicate. |
static <T> T |
IterableExtensions.findFirst(Iterable<T> iterable,
Functions.Function1<? super T,Boolean> predicate)
Finds the first element in the given iterable that fulfills the predicate.
|
static <T> T |
IteratorExtensions.findFirst(Iterator<T> iterator,
Functions.Function1<? super T,Boolean> predicate)
Finds the first element in the given iterator that fulfills the predicate.
|
static <T> T |
IterableExtensions.findLast(Iterable<T> iterable,
Functions.Function1<? super T,Boolean> predicate)
Finds the last element in the given iterable that fulfills the predicate.
|
static <T> T |
IteratorExtensions.findLast(Iterator<T> iterator,
Functions.Function1<? super T,Boolean> predicate)
Finds the last element in the given iterator that fulfills the predicate.
|
static <T> boolean |
IterableExtensions.forall(Iterable<T> iterable,
Functions.Function1<? super T,Boolean> predicate)
Returns
true if every element in iterable satisfies the predicate. |
static <T> boolean |
IteratorExtensions.forall(Iterator<T> iterator,
Functions.Function1<? super T,Boolean> predicate)
Returns
true if every element in iterator satisfies the predicate. |
static <K,V> Map<K,List<V>> |
IterableExtensions.groupBy(Iterable<? extends V> values,
Functions.Function1<? super V,? extends K> computeKeys)
Returns a map for which the
Map.values() is a collection of lists, where the elements in the list will
appear in the order as they appeared in the iterable. |
static <K,V> Map<K,List<V>> |
IteratorExtensions.groupBy(Iterator<? extends V> values,
Functions.Function1<? super V,? extends K> computeKeys)
Returns a map for which the
Map.values() is a collection of lists, where the elements in the list will
appear in the order as they appeared in the iterator. |
static <T> String |
IterableExtensions.join(Iterable<T> iterable,
CharSequence before,
CharSequence separator,
CharSequence after,
Functions.Function1<? super T,? extends CharSequence> function)
Returns the concatenated string representation of the elements in the given iterable.
|
static <T> String |
IterableExtensions.join(Iterable<T> iterable,
CharSequence separator,
Functions.Function1<? super T,? extends CharSequence> function)
Returns the concatenated string representation of the elements in the given iterable.
|
static <T> String |
IteratorExtensions.join(Iterator<T> iterator,
CharSequence before,
CharSequence separator,
CharSequence after,
Functions.Function1<? super T,? extends CharSequence> function)
Returns the concatenated string representation of the elements in the given iterator.
|
static <T> String |
IteratorExtensions.join(Iterator<T> iterator,
CharSequence separator,
Functions.Function1<? super T,? extends CharSequence> function)
Returns the concatenated string representation of the elements in the given iterator.
|
static <T,R> Iterable<R> |
IterableExtensions.map(Iterable<T> original,
Functions.Function1<? super T,? extends R> transformation)
Returns an iterable that performs the given
transformation for each element of original when
requested. |
static <T,R> Iterator<R> |
IteratorExtensions.map(Iterator<T> original,
Functions.Function1<? super T,? extends R> transformation)
Returns an iterator that performs the given
transformation for each element of original when
requested. |
static <T,R> List<R> |
ListExtensions.map(List<T> original,
Functions.Function1<? super T,? extends R> transformation)
Returns a list that performs the given
transformation for each element of original when
requested. |
static <K,V1,V2> Map<K,V2> |
MapExtensions.mapValues(Map<K,V1> original,
Functions.Function1<? super V1,? extends V2> transformation)
Returns a map that performs the given
transformation for each value of original when requested. |
static <T,C extends Comparable<? super C>> |
IterableExtensions.maxBy(Iterable<T> iterable,
Functions.Function1<? super T,C> compareBy)
Finds the element that yields the maximum value when passed to
compareBy If there are several
maxima, the first one will be returned. |
static <T,C extends Comparable<? super C>> |
IteratorExtensions.maxBy(Iterator<T> iterator,
Functions.Function1<? super T,C> compareBy)
Finds the element that yields the maximum value when passed to
compareBy If there are several
maxima, the first one will be returned. |
static <T,C extends Comparable<? super C>> |
IterableExtensions.minBy(Iterable<T> iterable,
Functions.Function1<? super T,C> compareBy)
Finds the element that yields the minimum value when passed to
compareBy. |
static <T,C extends Comparable<? super C>> |
IteratorExtensions.minBy(Iterator<T> iterator,
Functions.Function1<? super T,C> compareBy)
Finds the element that yields the minimum value when passed to
compareBy. |
static <T,C extends Comparable<? super C>> |
IterableExtensions.sortBy(Iterable<T> iterable,
Functions.Function1<? super T,C> key)
Creates a sorted list that contains the items of the given iterable.
|
static <T,C extends Comparable<? super C>> |
ListExtensions.sortInplaceBy(List<T> list,
Functions.Function1<? super T,C> key)
Sorts the specified list itself according to the order induced by applying a key function to each element which
yields a comparable criteria.
|
static <T> Iterable<T> |
IterableExtensions.takeWhile(Iterable<? extends T> iterable,
Functions.Function1<? super T,Boolean> predicate)
Returns an Iterable containing all elements starting from the head of the source up to and excluding the first
element that violates the predicate The resulting Iterable is a lazily computed view, so any modifications to the
underlying Iterables will be reflected on subsequent iterations.
|
static <T> Iterator<T> |
IteratorExtensions.takeWhile(Iterator<? extends T> iterator,
Functions.Function1<? super T,Boolean> predicate)
Returns an Iterator containing all elements starting from the head of the source up to and excluding the first
element that violates the predicate.
|
static <K,V> Map<K,V> |
IterableExtensions.toInvertedMap(Iterable<? extends K> keys,
Functions.Function1<? super K,V> computeValues)
Returns a map for which the
Map.values() are computed by the given function, and each key is an element in
the given keys. |
static <K,V> Map<K,V> |
IteratorExtensions.toInvertedMap(Iterator<? extends K> keys,
Functions.Function1<? super K,V> computeValues)
Returns a map for which the
Map.values() are computed by the given function, and each key is an element in
the given keys. |
static <K,V> Map<K,V> |
IterableExtensions.toMap(Iterable<? extends V> values,
Functions.Function1<? super V,K> computeKeys)
Returns a map for which the
Map.values() are the given elements in the given order, and each key is the
product of invoking a supplied function computeKeys on its corresponding value. |
static <K,V> Map<K,V> |
IteratorExtensions.toMap(Iterator<? extends V> values,
Functions.Function1<? super V,K> computeKeys)
Returns a map for which the
Map.values() are the given elements in the given order, and each key is the
product of invoking a supplied function computeKeys on its corresponding value. |
| Constructor and Description |
|---|
BooleanFunctionDelegate(Functions.Function1<? super T,Boolean> delegate)
Creates a new
BooleanFunctionDelegate that wraps the given delegate function. |
FunctionDelegate(Functions.Function1<? super P,? extends R> delegate)
Creates a new
FunctionDelegate that wraps the given delegate function. |
KeyComparator(Functions.Function1<? super T,C> keyFunction) |
Copyright © 2015. All Rights Reserved.