public class StateSet<S extends IndexedState> extends Object implements Set<S>, Iterable<S>
IndexedState, they are referenced by IndexedState.getId(). Up to a size of four,
this set uses a list of short values compressed into one long to store the
indices. When the set grows larger than four elements, the indices are stored in a
StateSetBackingSet, which can be set in the constructor.| Modifier | Constructor and Description |
|---|---|
|
StateSet(StateIndex<? super S> stateIndex) |
|
StateSet(StateIndex<? super S> stateIndex,
StateSetBackingSetFactory backingSetFactory) |
protected |
StateSet(StateSet<S> copy) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(S state) |
boolean |
addAll(Collection<? extends S> c) |
void |
addBatch(S state) |
void |
addBatchFinish() |
void |
clear() |
boolean |
contains(Object state) |
boolean |
containsAll(Collection<?> c) |
StateSet<S> |
copy() |
boolean |
equals(Object obj)
Compares the specified object with this set for equality.
|
StateIndex<? super S> |
getStateIndex() |
int |
hashCode()
Returns the hash code value for this set.
|
protected PrimitiveIterator.OfInt |
intIterator() |
boolean |
isDisjoint(StateSet<? extends S> other) |
boolean |
isEmpty() |
Iterator<S> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
void |
replace(S oldState,
S newState) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Stream<S> |
stream() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitspliteratorparallelStream, removeIfpublic StateSet(StateIndex<? super S> stateIndex, StateSetBackingSetFactory backingSetFactory)
public StateSet(StateIndex<? super S> stateIndex)
public StateIndex<? super S> getStateIndex()
public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<S extends IndexedState>public int size()
size in interface Collection<E>size in interface Set<S extends IndexedState>public boolean contains(Object state)
contains in interface Collection<E>contains in interface Set<S extends IndexedState>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface Set<S extends IndexedState>public boolean add(S state)
add in interface Collection<E>add in interface Set<S extends IndexedState>public boolean addAll(Collection<? extends S> c)
addAll in interface Collection<E>addAll in interface Set<S extends IndexedState>public void addBatch(S state)
public void addBatchFinish()
public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<S extends IndexedState>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface Set<S extends IndexedState>public void clear()
clear in interface Collection<E>clear in interface Set<S extends IndexedState>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface Set<S extends IndexedState>public int hashCode()
Sets, the hash code value returned by this implementation is
not the sum of the hash codes of its elements.hashCode in interface Collection<E>hashCode in interface Set<S extends IndexedState>hashCode in class ObjectSet.hashCode()public boolean equals(Object obj)
Set s, StateSets are only equal to other
StateSets.equals in interface Collection<E>equals in interface Set<S extends IndexedState>equals in class ObjectSet.equals(Object)protected PrimitiveIterator.OfInt intIterator()
public Iterator<S> iterator()
iterator in interface Iterable<S extends IndexedState>iterator in interface Collection<E>iterator in interface Set<S extends IndexedState>public Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<S extends IndexedState>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface Set<S extends IndexedState>public Stream<S> stream()
stream in interface Collection<E>