Package com.github.tommyettinger.ds
Class EnumMap.Keys
- All Implemented Interfaces:
EnhancedCollection<Enum<?>>,Iterable<Enum<?>>,Collection<Enum<?>>,Set<Enum<?>>
- Direct Known Subclasses:
EnumOrderedMap.OrderedMapKeys
public static class EnumMap.Keys
extends AbstractSet<Enum<?>>
implements EnhancedCollection<Enum<?>>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<Enum<?>>appendInto(Collection<Enum<?>> coll) Append the remaining items that this can iterate through into the given Collection.voidclear()booleanbooleaninthashCode()EnumMap.MapIterator<?,Enum<?>> iterator()Returns an iterator over the elements contained in this collection.booleanbooleanremoveAll(Collection<?> c) Removes from this set all of its elements that are contained in the specified collection (optional operation).voidThe iterator is reused by this data structure, and you can reset it back to the start of the iteration order using this.intsize()Object[]toArray()<T> T[]toArray(T[] a) Returns a newEnumSetcontaining the remaining items.ObjectList<Enum<?>>toList()Returns a newObjectListcontaining the remaining items.toString()Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, isEmpty, retainAllMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface com.github.tommyettinger.ds.EnhancedCollection
add, add, add, addAll, addAll, addAll, addAllIterable, addLegible, addLegible, addVarargs, appendTo, appendTo, containsAll, containsAll, containsAll, containsAllIterable, containsAny, containsAny, containsAny, containsAnyIterable, first, removeAll, removeAll, removeAll, removeAllIterable, removeEach, removeEach, removeEach, removeEachIterable, toString, toString, toStringMethods inherited from interface java.util.Set
add, addAll, containsAll, isEmpty, retainAll, spliterator
-
Field Details
-
iter
-
-
Constructor Details
-
Keys
-
-
Method Details
-
contains
- Specified by:
containsin interfaceCollection<Enum<?>>- Specified by:
containsin interfaceSet<Enum<?>>- Overrides:
containsin classAbstractCollection<Enum<?>>
-
remove
- Specified by:
removein interfaceCollection<Enum<?>>- Specified by:
removein interfaceSet<Enum<?>>- Overrides:
removein classAbstractCollection<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
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:
removeAllin interfaceCollection<Enum<?>>- Specified by:
removeAllin interfaceSet<Enum<?>>- Overrides:
removeAllin classAbstractSet<Enum<?>>- Parameters:
c- collection containing elements to be removed from this set- Returns:
trueif this set changed as a result of the call
-
iterator
Returns an iterator over the elements contained in this collection. -
clear
public void clear()- Specified by:
clearin interfaceCollection<Enum<?>>- Specified by:
clearin interfaceSet<Enum<?>>- Overrides:
clearin classAbstractCollection<Enum<?>>
-
toString
- Overrides:
toStringin classAbstractCollection<Enum<?>>
-
size
public int size()- Specified by:
sizein interfaceCollection<Enum<?>>- Specified by:
sizein interfaceSet<Enum<?>>- Specified by:
sizein classAbstractCollection<Enum<?>>
-
equals
- Specified by:
equalsin interfaceCollection<Enum<?>>- Specified by:
equalsin interfaceSet<Enum<?>>- Overrides:
equalsin classAbstractSet<Enum<?>>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Enum<?>>- Specified by:
hashCodein interfaceSet<Enum<?>>- Overrides:
hashCodein classAbstractSet<Enum<?>>
-
resetIterator
public void resetIterator()The iterator is reused by this data structure, and you can reset it back to the start of the iteration order using this. -
toArray
- Specified by:
toArrayin interfaceCollection<Enum<?>>- Specified by:
toArrayin interfaceSet<Enum<?>>- Overrides:
toArrayin classAbstractCollection<Enum<?>>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<Enum<?>>- Specified by:
toArrayin interfaceSet<Enum<?>>- Overrides:
toArrayin classAbstractCollection<Enum<?>>- Parameters:
a-
-
toList
Returns a newObjectListcontaining the remaining items. Does not change the position of this iterator.- Returns:
- a new ObjectList containing the remaining items
-
toEnumSet
Returns a newEnumSetcontaining 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
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
-