T
- A type that all elements in the domain share.public interface Domain<T> extends List<T>, Set<T>, Serializable
DomainBitSet
can contain. This is also known as the
universe of discourse. It is a set with the following characteristics:
List
),Set
),null
).Spliterator
returned by spliterator()
also indicates most of these
characteristics.
A domain should have a fast implementation of List.indexOf(Object)
, so that conversions of
the DomainBitSet are fast.
Modifier and Type | Method and Description |
---|---|
boolean |
add(T e)
Domain is immutable and therefore does not support this method.
|
boolean |
addAll(Collection<? extends T> c)
Domain is immutable and therefore does not support this method.
|
void |
clear()
Domain is immutable and therefore does not support this method.
|
boolean |
equals(Object other)
Two domains are defined to be equal if they contain the same elements in the same order.
|
Function<Collection<T>,DomainBitSet<T>> |
factory()
Creates a factory to create new sets with this domain.
|
int |
hashCode()
Returns the hash code value for this domain.
|
static <T> Domain<T> |
of(Collection<? extends T> elements)
Creates a Domain of the given elements. if the given collection is a Domain then the same
reference is refurned.
|
static <T> Domain<T> |
of(T... elements)
Creates a Domain of the given elements.
|
default boolean |
remove(Object o)
Domain is immutable and therefore does not support this method.
|
default boolean |
removeAll(Collection<?> c)
Domain is immutable and therefore does not support this method.
|
default boolean |
removeIf(Predicate<? super T> filter)
Domain is immutable and therefore does not support this method.
|
default boolean |
retainAll(Collection<?> c)
Domain is immutable and therefore does not support this method.
|
default Spliterator<T> |
spliterator() |
add, addAll, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, replaceAll, set, size, sort, subList, toArray, toArray
contains, containsAll, isEmpty, iterator, size, toArray, toArray
parallelStream, stream
@SafeVarargs static <T> Domain<T> of(T... elements)
elements
- Elements of the domain.static <T> Domain<T> of(Collection<? extends T> elements)
elements
- Elements of the domain. The collection must be ordered.boolean equals(Object other)
Function<Collection<T>,DomainBitSet<T>> factory()
The returned DomainBitSet is optimized for this Domain.
BitSetUtilities.toDomainBitSet(Domain)
int hashCode()
java.util.Arrays.hashCode(this.toArray())
default Spliterator<T> spliterator()
spliterator
in interface Collection<T>
spliterator
in interface Iterable<T>
spliterator
in interface List<T>
spliterator
in interface Set<T>
boolean add(T e)
boolean addAll(Collection<? extends T> c)
void clear()
default boolean remove(Object o)
default boolean removeAll(Collection<?> c)
default boolean retainAll(Collection<?> c)
default boolean removeIf(Predicate<? super T> filter)
removeIf
in interface Collection<T>