|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.common.util.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 int |
indexOf(List list,
Object o,
int fromIndex)
Searches for the first occurence of the given argument in list starting from a specified index. |
static Object |
move(List list,
int targetIndex,
int sourceIndex)
Moves the object from the old position to the new position. |
static void |
move(List list,
int newPosition,
Object 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 void |
setEList(EList eList,
List 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 void |
sort(EList list,
Comparator comparator)
Sorts the specified list based on the order defined by the specified comparator. |
static EList |
unmodifiableEList(EList list)
Returns an unmodifiable view of the list. |
static EMap |
unmodifiableEMap(EMap 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 void move(List list, int newPosition, Object object)
list
- newPosition
- the position of the object after the move.object
- the object to move.public static Object move(List 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(List list, 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 void sort(EList list, Comparator comparator)
Collections.sort(java.util.List, java.util.Comparator)
to
avoid errors when sorting unique lists.
public static void setEList(EList eList, List prototypeList)
eList
's contents and order to be exactly that of the prototype
list.
This implementation mimimizes 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 EList unmodifiableEList(EList list)
public static EMap unmodifiableEMap(EMap map)
|
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 |