Package eu.simuline.util
Enum CollectionsExt.Modification
- java.lang.Object
-
- java.lang.Enum<CollectionsExt.Modification>
-
- eu.simuline.util.CollectionsExt.Modification
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CollectionsExt.Modification>
- Enclosing class:
- CollectionsExt<E>
public static enum CollectionsExt.Modification extends java.lang.Enum<CollectionsExt.Modification>
Enumerates the kinds of modifications on aCollection. A collection is modified either directly or via its iterator's methodIterator.remove(). The direct modifications split in adding and removing a single object, clearing the whole collection and bulk operations like adding, removing, retaining all objects which are in anotherCollection. Subinterfaces ofCollectionmay offer further kinds of modifications:SortedSets for example define views on the original set
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AddObjModification adding an element which may be byCollection.add(Object),Collection.addAll(Collection), byList.add(int, Object),List.addAll(int, Collection),RemoveObjModification byCollection.remove(Object),Collection.removeAll(Collection),Collection.retainAll(Collection),Collection.removeIf(Predicate),Collection.clear()and byList.remove(int).SetObjModification byList.set(int, Object),List.replaceAll(UnaryOperator)andList.sort(Comparator).
-
Constructor Summary
Constructors Modifier Constructor Description privateModification()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CollectionsExt.ModificationvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CollectionsExt.Modification[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AddObj
public static final CollectionsExt.Modification AddObj
Modification adding an element which may be byCollection.add(Object),Collection.addAll(Collection), byList.add(int, Object),List.addAll(int, Collection),. * Modification by
ListIterator.add(Object)of (list)-iterator attached with underlyingListviaList.listIterator()orList.listIterator(int).
-
RemoveObj
public static final CollectionsExt.Modification RemoveObj
Modification byCollection.remove(Object),Collection.removeAll(Collection),Collection.retainAll(Collection),Collection.removeIf(Predicate),Collection.clear()and byList.remove(int).Modification by
Iterator.remove()of iterator attached with underlyingCollectionviaCollection.iterator(),List.listIterator()orList.listIterator(int).
-
SetObj
public static final CollectionsExt.Modification SetObj
Modification byList.set(int, Object),List.replaceAll(UnaryOperator)andList.sort(Comparator).Modification by
ListIterator.set(Object)of iterator attached with underlyingListviaList.listIterator()orList.listIterator(int).
-
-
Method Detail
-
values
public static CollectionsExt.Modification[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CollectionsExt.Modification c : CollectionsExt.Modification.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CollectionsExt.Modification valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-