|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtext.xbase.lib.CollectionExtensions
public class CollectionExtensions
This is an extension library for collections
.
Constructor Summary | |
---|---|
CollectionExtensions()
|
Method Summary | ||
---|---|---|
static
|
addAll(java.util.Collection<? super T> collection,
T... elements)
Adds all of the specified elements to the specified collection. |
|
static
|
addAll(java.util.Collection<T> collection,
java.lang.Iterable<? extends T> elements)
Adds all of the specified elements to the specified collection. |
|
static
|
immutableCopy(java.util.List<? extends T> list)
Returns an immutable copy of the specified list . |
|
static
|
immutableCopy(java.util.Map<? extends K,? extends V> map)
Returns an immutable copy of the specified map . |
|
static
|
immutableCopy(java.util.Set<? extends T> set)
Returns an immutable copy of the specified set . |
|
static
|
immutableCopy(java.util.SortedMap<K,? extends V> map)
Returns an immutable copy of the specified sorted map . |
|
static
|
immutableCopy(java.util.SortedSet<T> set)
Returns an immutable copy of the specified sorted set . |
|
static
|
operator_add(java.util.Collection<? super E> collection,
E value)
The operator mapping from += to Collection.add(Object) . |
|
static
|
operator_add(java.util.Collection<E> collection,
java.lang.Iterable<? extends E> newElements)
The operator mapping from += to #addAll(Collection) . |
|
static
|
unmodifiableView(java.util.Collection<? extends T> collection)
Returns an unmodifiable view of the specified collection . |
|
static
|
unmodifiableView(java.util.List<? extends T> list)
Returns an unmodifiable view of the specified list . |
|
static
|
unmodifiableView(java.util.Map<? extends K,? extends V> map)
Returns an unmodifiable view of the specified map . |
|
static
|
unmodifiableView(java.util.Set<? extends T> set)
Returns an unmodifiable view of the specified set . |
|
static
|
unmodifiableView(java.util.SortedMap<K,? extends V> map)
Returns an unmodifiable view of the specified sorted map . |
|
static
|
unmodifiableView(java.util.SortedSet<T> set)
Returns an unmodifiable view of the specified sorted set . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionExtensions()
Method Detail |
---|
public static <E> boolean operator_add(java.util.Collection<? super E> collection, E value)
+=
to Collection.add(Object)
. Returns true
if the
collection changed due to this operation.
collection
- the to-be-changed collection. May not be null
.value
- the value that should be added to the collection.
true
if the collection changed due to this operation.Collection.add(Object)
public static <E> boolean operator_add(java.util.Collection<E> collection, java.lang.Iterable<? extends E> newElements)
+=
to #addAll(Collection)
. Returns true
if the
collection changed due to this operation.
collection
- the to-be-changed collection. May not be null
.newElements
- elements to be inserted into the collection. May not be null
but may contain
null
elements if the the target collection supports null
elements.
true
if the collection changed due to this operation.addAll(Collection, Iterable)
public static <T> java.util.List<T> unmodifiableView(java.util.List<? extends T> list)
list
.
list
- the list for which an unmodifiable view is to be returned. May not be null
.
Collections.unmodifiableList(List)
public static <T> java.util.Collection<T> unmodifiableView(java.util.Collection<? extends T> collection)
collection
.
collection
- the collection for which an unmodifiable view is to be returned. May not be null
.
Collections.unmodifiableCollection(Collection)
public static <T> java.util.Set<T> unmodifiableView(java.util.Set<? extends T> set)
set
.
set
- the set for which an unmodifiable view is to be returned. May not be null
.
Collections.unmodifiableSet(Set)
public static <T> java.util.SortedSet<T> unmodifiableView(java.util.SortedSet<T> set)
set
.
set
- the sorted set for which an unmodifiable view is to be returned. May not be null
.
Collections.unmodifiableSortedSet(SortedSet)
public static <K,V> java.util.Map<K,V> unmodifiableView(java.util.Map<? extends K,? extends V> map)
map
.
map
- the map for which an unmodifiable view is to be returned. May not be null
.
Collections.unmodifiableMap(Map)
public static <K,V> java.util.SortedMap<K,V> unmodifiableView(java.util.SortedMap<K,? extends V> map)
map
.
map
- the sorted map for which an unmodifiable view is to be returned. May not be null
.
Collections.unmodifiableSortedMap(SortedMap)
public static <T> java.util.List<T> immutableCopy(java.util.List<? extends T> list)
list
.
list
- the list for which an immutable copy should be created. May not be null
.
public static <T> java.util.Set<T> immutableCopy(java.util.Set<? extends T> set)
set
.
set
- the set for which an immutable copy should be created. May not be null
.
public static <T> java.util.SortedSet<T> immutableCopy(java.util.SortedSet<T> set)
set
.
set
- the sorted set for which an immutable copy should be created. May not be null
.
public static <K,V> java.util.Map<K,V> immutableCopy(java.util.Map<? extends K,? extends V> map)
map
.
map
- the map for which an immutable copy should be created. May not be null
.
public static <K,V> java.util.SortedMap<K,V> immutableCopy(java.util.SortedMap<K,? extends V> map)
map
.
map
- the sorted map for which an immutable copy should be created. May not be null
.
public static <T> boolean addAll(java.util.Collection<? super T> collection, T... elements)
collection
- the collection into which the elements
are to be inserted. May not be null
.elements
- the elements to insert into the collection
. May not be null
but may contain
null
entries if the collection
allows that.
true
if the collection changed as a result of the callpublic static <T> boolean addAll(java.util.Collection<T> collection, java.lang.Iterable<? extends T> elements)
collection
- the collection into which the elements
are to be inserted. May not be null
.elements
- the elements to insert into the collection
. May not be null
but may contain
null
entries if the collection
allows that.
true
if the collection changed as a result of the call
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |