Class EnumMap.Keys

java.lang.Object
java.util.AbstractCollection<Enum<?>>
java.util.AbstractSet<Enum<?>>
com.github.tommyettinger.ds.EnumMap.Keys
All Implemented Interfaces:
EnhancedCollection<Enum<?>>, Iterable<Enum<?>>, Collection<Enum<?>>, Set<Enum<?>>
Direct Known Subclasses:
EnumOrderedMap.OrderedMapKeys
Enclosing class:
EnumMap<V>

public static class EnumMap.Keys extends AbstractSet<Enum<?>> implements EnhancedCollection<Enum<?>>
  • Field Details

  • Constructor Details

    • Keys

      public Keys(EnumMap<?> map)
  • Method Details

    • contains

      public boolean contains(Object o)
      Specified by:
      contains in interface Collection<Enum<?>>
      Specified by:
      contains in interface Set<Enum<?>>
      Overrides:
      contains in class AbstractCollection<Enum<?>>
    • remove

      public boolean remove(Object o)
      Specified by:
      remove in interface Collection<Enum<?>>
      Specified by:
      remove in interface Set<Enum<?>>
      Overrides:
      remove in class AbstractCollection<Enum<?>>
      Parameters:
      o - the item to try to remove
      Returns:
      true if this map was modified (meaning the item was removed successfully); false otherwise
    • removeAll

      public boolean removeAll(Collection<?> c)
      Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a set, this operation effectively modifies this set so that its value is the asymmetric set difference of the two sets.
      Specified by:
      removeAll in interface Collection<Enum<?>>
      Specified by:
      removeAll in interface Set<Enum<?>>
      Overrides:
      removeAll in class AbstractSet<Enum<?>>
      Parameters:
      c - collection containing elements to be removed from this set
      Returns:
      true if this set changed as a result of the call
    • iterator

      public EnumMap.MapIterator<?,Enum<?>> iterator()
      Returns an iterator over the elements contained in this collection.
      Specified by:
      iterator in interface Collection<Enum<?>>
      Specified by:
      iterator in interface Iterable<Enum<?>>
      Specified by:
      iterator in interface Set<Enum<?>>
      Specified by:
      iterator in class AbstractCollection<Enum<?>>
      Returns:
      an iterator over the elements contained in this collection
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<Enum<?>>
      Specified by:
      clear in interface Set<Enum<?>>
      Overrides:
      clear in class AbstractCollection<Enum<?>>
    • toString

      public String toString()
      Overrides:
      toString in class AbstractCollection<Enum<?>>
    • size

      public int size()
      Specified by:
      size in interface Collection<Enum<?>>
      Specified by:
      size in interface Set<Enum<?>>
      Specified by:
      size in class AbstractCollection<Enum<?>>
    • toArray

      public Object[] toArray()
      Specified by:
      toArray in interface Collection<Enum<?>>
      Specified by:
      toArray in interface Set<Enum<?>>
      Overrides:
      toArray in class AbstractCollection<Enum<?>>
    • toArray

      public <T> T[] toArray(T[] a)
      Specified by:
      toArray in interface Collection<Enum<?>>
      Specified by:
      toArray in interface Set<Enum<?>>
      Overrides:
      toArray in class AbstractCollection<Enum<?>>
      Parameters:
      a -
    • toList

      public ObjectList<Enum<?>> toList()
      Returns a new ObjectList containing the remaining items. Does not change the position of this iterator.
      Returns:
      a new ObjectList containing the remaining items
    • toEnumSet

      public EnumSet toEnumSet()
      Returns a new EnumSet containing the remaining items. Does not change the position of this iterator. The EnumSet this returns will share a key universe with the map linked to this key set.
      Returns:
      a new EnumSet containing the remaining items, sharing a universe with this key set
    • appendInto

      public Collection<Enum<?>> appendInto(Collection<Enum<?>> coll)
      Append the remaining items that this can iterate through into the given Collection. Does not change the position of this iterator.
      Parameters:
      coll - any modifiable Collection; may have items appended into it
      Returns:
      the given collection, potentially after modifications