public class XcoreEListExtensions
extends java.lang.Object
ELists
.Constructor and Description |
---|
XcoreEListExtensions() |
Modifier and Type | Method and Description |
---|---|
static <T> EList<T> |
immutableCopy(EList<? extends T> list)
Returns an immutable copy of the specified list.
|
static <T,R> EList<R> |
map(EList<T> list,
Returns a transformed view of the given list.
|
static <T> EList<T> |
reverse(EList<T> list)
Reverses the order of the elements in the specified list.
|
static <T> EList<T> |
reverseView(EList<T> list)
Provides a reverse view of the given list which is especially useful for traversing a list backwards in a for-each loop.
|
static <T extends java.lang.Comparable<? super T>> |
sortInplace(EList<T> list)
Sorts the specified list itself into ascending order according to the natural ordering of its elements.
|
static <T> EList<T> |
sortInplace(EList<T> list,
java.util.Comparator<? super T> comparator)
Sorts the specified list itself into ascending according to the order induced by the specified comparator.
|
static <T,C extends java.lang.Comparable<? super C>> |
sortInplaceBy(EList<T> list,
Sorts the specified list in ascending order according to the nature order of the corresponding element induced by the key function.
|
static <T> EList<T> |
unmodifiableView(EList<? extends T> list)
Returns an unmodifiable view of the specified list.
|
public static <T> EList<T> unmodifiableView(EList<? extends T> list)
list
- the list for which an unmodifiable view is to be returned. May not be null
.public static <T> EList<T> immutableCopy(EList<? extends T> list)
list
- the list for which an immutable copy should be created. May not be null
.public static <T extends java.lang.Comparable<? super T>> EList<T> sortInplace(EList<T> list)
list
- the list to be sorted. May not be null
.public static <T> EList<T> sortInplace(EList<T> list, java.util.Comparator<? super T> comparator)
list
- the list to be sorted. May not be null
.comparator
- the comparator to be used; it may be null
to indicate that the natural ordering of the elements should be used.public static <T,C extends java.lang.Comparable<? super C>> EList<T> sortInplaceBy(EList<T> list,key)
list
- the list to be sorted. May not be null
.key
- the key function to induce comparison keys. May not be null
.public static <T> EList<T> reverseView(EList<T> list)
list
- the list whose elements should be viewed in reverse. May not be null
.public static <T> EList<T> reverse(EList<T> list)
list
- the list whose elements are to be reversed.java.lang.UnsupportedOperationException
- if the specified list does not support move
.public static <T,R> EList<R> map(EList<T> list,transformation)
list
- the list to map. May not be null
.transformation
- the transformation to induce the mapping. May not be null
.