|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.common.util.ECollections
public class ECollections
Support for empty
and unmodifiable
EList
s.
Field Summary | |
---|---|
static EList<?> |
EMPTY_ELIST
An unmodifiable empty list with an efficient reusable iterator. |
static EMap<?,?> |
EMPTY_EMAP
An unmodifiable empty map with an efficient reusable iterator. |
Method Summary | ||
---|---|---|
static
|
emptyEList()
|
|
static
|
emptyEMap()
|
|
static int |
indexOf(java.util.List<?> list,
java.lang.Object o,
int fromIndex)
Searches for the first occurrence of the given argument in list starting from a specified index. |
|
static
|
move(java.util.List<T> list,
int targetIndex,
int sourceIndex)
Moves the object from the old position to the new position. |
|
static
|
move(java.util.List<T> list,
int newPosition,
T object)
Moves the object to the new position, if is in the list. |
|
static void |
reverse(EList<?> list)
Reverses the order of the elements in the specified EList. |
|
static
|
setEList(EList<T> eList,
java.util.List<? extends T> prototypeList)
Sets the eList 's contents and order to be exactly that of the prototype list. |
|
static void |
sort(EList<?> list)
Sorts the specified list. |
|
static
|
sort(EList<T> list,
java.util.Comparator<? super T> comparator)
Sorts the specified list based on the order defined by the specified comparator. |
|
static
|
unmodifiableEList(EList<? extends T> list)
Returns an unmodifiable view of the list. |
|
static
|
unmodifiableEMap(EMap<? extends K,? extends V> map)
Returns an unmodifiable view of the map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final EList<?> EMPTY_ELIST
public static final EMap<?,?> EMPTY_EMAP
Method Detail |
---|
public static <T> void move(java.util.List<T> list, int newPosition, T object)
list
- newPosition
- the position of the object after the move.object
- the object to move.public static <T> T move(java.util.List<T> list, int targetIndex, int sourceIndex)
list
- targetIndex
- the position of the object after the move.sourceIndex
- the position of the object before the move.
public static void reverse(EList<?> list)
public static int indexOf(java.util.List<?> list, java.lang.Object o, int fromIndex)
list
- o
- an object (can be null)fromIndex
-
public static void sort(EList<?> list)
Collections.sort(java.util.List)
to
avoid errors when sorting unique lists.
public static <T> void sort(EList<T> list, java.util.Comparator<? super T> comparator)
Collections.sort(java.util.List, java.util.Comparator)
to
avoid errors when sorting unique lists.
public static <T> void setEList(EList<T> eList, java.util.List<? extends T> prototypeList)
eList
's contents and order to be exactly that of the prototype
list.
This implementation minimizes the number of notifications the operation will produce.
Objects already in the list will be moved, missing objects will be added, and extra objects will be removed.
If eList
's contents and order are already exactly that of the prototype
list,
no change will be made.
eList
- the list to set.prototypeList
- the list representing the desired content and order.public static <T> EList<T> unmodifiableEList(EList<? extends T> list)
public static <K,V> EMap<K,V> unmodifiableEMap(EMap<? extends K,? extends V> map)
public static <T> EList<T> emptyEList()
public static <K,V> EMap<K,V> emptyEMap()
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |