Enum 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 a Collection. A collection is modified either directly or via its iterator's method Iterator.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 another Collection. Subinterfaces of Collection may offer further kinds of modifications: SortedSets for example define views on the original set
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AddObj
      Modification adding an element which may be by Collection.add(Object), Collection.addAll(Collection), by List.add(int, Object), List.addAll(int, Collection),
      RemoveObj
      Modification by Collection.remove(Object), Collection.removeAll(Collection), Collection.retainAll(Collection), Collection.removeIf(Predicate), Collection.clear() and by List.remove(int).
      SetObj
      Modification by List.set(int, Object), List.replaceAll(UnaryOperator) and List.sort(Comparator).
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Modification()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CollectionsExt.Modification valueOf​(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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • AddObj

        public static final CollectionsExt.Modification AddObj
        Modification adding an element which may be by Collection.add(Object), Collection.addAll(Collection), by List.add(int, Object), List.addAll(int, Collection),

        . * Modification by ListIterator.add(Object) of (list)-iterator attached with underlying List via List.listIterator() or List.listIterator(int).

      • RemoveObj

        public static final CollectionsExt.Modification RemoveObj
        Modification by Collection.remove(Object), Collection.removeAll(Collection), Collection.retainAll(Collection), Collection.removeIf(Predicate), Collection.clear() and by List.remove(int).

        Modification by Iterator.remove() of iterator attached with underlying Collection via Collection.iterator(), List.listIterator() or List.listIterator(int).

      • SetObj

        public static final CollectionsExt.Modification SetObj
        Modification by List.set(int, Object), List.replaceAll(UnaryOperator) and List.sort(Comparator).

        Modification by ListIterator.set(Object) of iterator attached with underlying List via List.listIterator() or List.listIterator(int).

    • Constructor Detail

      • Modification

        private Modification()
    • 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 name
        java.lang.NullPointerException - if the argument is null