T
- the type of the axiom to collect.public static class DescriptorEntitySet.EntitySetBase<T> extends java.util.HashSet<T> implements Axiom.EntitySet<T>
DescriptorEntitySet
that extends EntitySet
.
This class implements common features for managing an HashSet
and a singleton
value
for EntitySet
.
Axiom.EntitySet.SynchronisationIntent<E>
Modifier and Type | Field and Description |
---|---|
protected boolean |
singleton
the actual singleton flagging value.
|
Constructor and Description |
---|
EntitySetBase()
Instantiate this
EntitySet as an empty HashSet . |
EntitySetBase(java.util.Collection<? extends T> c)
Instantiate this
EntitySet as a HashSet containing the given value. |
EntitySetBase(int initialCapacity)
Instantiate this
EntitySet as a HashSet with a given initial size. |
EntitySetBase(int initialCapacity,
float loadFactor)
Instantiate this
EntitySet as a HashSet with a given initial size and load factor. |
Modifier and Type | Method and Description |
---|---|
boolean |
isSingleton()
Describes whether this EntitySet contains a single element.
|
void |
setSingleton(boolean singleton)
Set this EntitySet to contain a single element.
|
java.lang.String |
toString() |
add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
addAll, containsAll, retainAll, toArray, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
synchroniseFrom, synchroniseTo
protected boolean singleton
false
.public EntitySetBase()
EntitySet
as an empty HashSet
.
It is not set to be a singleton
.public EntitySetBase(java.util.Collection<? extends T> c)
EntitySet
as a HashSet
containing the given value.
It is not set to be singleton
.c
- the element with wich setGround the set of EntitySet
.public EntitySetBase(int initialCapacity, float loadFactor)
EntitySet
as a HashSet
with a given initial size and load factor.
It is not set to be singleton
.initialCapacity
- the initial capacity of the axioms HashSet
.loadFactor
- the load factor of the axioms HashSet
public EntitySetBase(int initialCapacity)
EntitySet
as a HashSet
with a given initial size.
It is not set to be singleton
.initialCapacity
- the initial capacity of the axioms HashSet
.public boolean isSingleton()
Axiom.EntitySet
isSingleton
in interface Axiom.EntitySet<T>
public void setSingleton(boolean singleton)
Axiom.EntitySet
setSingleton
in interface Axiom.EntitySet<T>
singleton
- (true) if this is a singleton set, (false) otherwise.public java.lang.String toString()
toString
in class java.util.AbstractCollection<T>