Package com.github.tommyettinger.ds
Class EnumIntMap.Keys
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<Enum<?>>
com.github.tommyettinger.ds.EnumSet
com.github.tommyettinger.ds.EnumIntMap.Keys
- All Implemented Interfaces:
EnhancedCollection<Enum<?>>,Iterable<Enum<?>>,Collection<Enum<?>>,Set<Enum<?>>
- Direct Known Subclasses:
EnumIntOrderedMap.OrderedMapKeys
- Enclosing class:
- EnumIntMap
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.tommyettinger.ds.EnumSet
EnumSet.EnumSetIterator -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the specified element to this set if it is not already present (optional operation).booleanAdds all Enum items in the given array to this set.booleanaddAll(Collection<? extends Enum<?>> c) Adds all the elements in the specified collection to this collection.Collection<Enum<?>>appendInto(Collection<Enum<?>> coll) Append the remaining items that this can iterate through into the given Collection.voidclear()Removes all the elements from this set.booleanReturnstrueif this set contains the specified element.booleaninthashCode()iterator()Returns an iterator over the elements contained in this collection.booleanRemoves the specified element from this set if it is present (optional operation).booleanremoveAll(Collection<?> c) Removes from this EnumSet every element in the given Collection.voidThe iterator is reused by this data structure, and you can reset it back to the start of the iteration order using this.intsize()Returns the number of elements in this set (its cardinality).Returns a newEnumSetcontaining the remaining items.ObjectList<Enum<?>>toList()Returns a newObjectListcontaining the remaining items.Methods inherited from class com.github.tommyettinger.ds.EnumSet
allOf, allOf, clearToUniverse, clearToUniverse, complementOf, containsAll, copyOf, getUniverse, isEmpty, nextEnum, nextEnum, nextOrdinal, noneOf, noneOf, of, of, parse, parse, parse, range, retainAll, toString, truncate, with, with, with, with, with, with, with, with, withMethods inherited from class java.util.AbstractCollection
toArray, toArrayMethods 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, 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
spliterator, toArray, toArray
-
Field Details
-
iter
-
-
Constructor Details
-
Keys
-
-
Method Details
-
add
Description copied from class:EnumSetAdds the specified element to this set if it is not already present (optional operation). More formally, adds the specified elementeto this set if the set contains no elemente2such thatObjects.equals(e, e2). If this set already contains the element, the call leaves the set unchanged and returnsfalse. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including
null, and throw an exception, as described in the specification forCollection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain. -
addAll
Description copied from class:EnumSetAdds all the elements in the specified collection to this collection. -
addAll
Description copied from class:EnumSetAdds all Enum items in the given array to this set. Returns true if this set was modified at all in the process (that is, if any items incwere not already present in this set).- Specified by:
addAllin interfaceEnhancedCollection<Enum<?>>- Overrides:
addAllin classEnumSet- See Also:
-
contains
Description copied from class:EnumSetReturnstrueif this set contains the specified element. More formally, returnstrueif and only if this set contains an elementesuch thatObjects.equals(item, e). -
remove
Description copied from class:EnumSetRemoves the specified element from this set if it is present (optional operation). More formally, removes an elementesuch thatObjects.equals(item, e), if this set contains such an element. Returnstrueif this set contained the element (or equivalently, if this set changed as a result of the call). (This set will not contain the element once the call returns.) -
removeAll
Description copied from class:EnumSetRemoves from this EnumSet every element in the given Collection. -
iterator
Returns an iterator over the elements contained in this collection. -
clear
public void clear()Removes all the elements from this set. The set will be empty after this call returns. This does not change the universe of possible Enum items this can hold. -
size
public int size()Description copied from class:EnumSetReturns the number of elements in this set (its cardinality). If this set contains more thanInteger.MAX_VALUEelements, returnsInteger.MAX_VALUE. -
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. -
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
-