Package eu.bandm.tools.ops
Class RtArraySet<D>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<D>
eu.bandm.tools.ops.RtArraySet<D>
- Type Parameters:
D
- the underlying value type from which the sets are constructed.
- All Implemented Interfaces:
Iterable<D>
,Collection<D>
,Set<D>
A set implementation for real-time application.
Based on an array of references.
ATTENTION: This class restricts the contract of "Iterator":
Once "
hasNext()==false
" has returned, all following behaviour
is unspecified and further usage forbidden. (The Iterator object will be recycled.)-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractSet
removeAll
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
addAll, contains, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
-
Constructor Details
-
RtArraySet
public RtArraySet(int capacity) -
RtArraySet
public RtArraySet(int capacity, int iterators)
-
-
Method Details
-
equals
Delegate directly to superclass. Only semantics shall be subject to equals(), not the implementation.- Specified by:
equals
in interfaceCollection<D>
- Specified by:
equals
in interfaceSet<D>
- Overrides:
equals
in classAbstractSet<D>
-
hashCode
public int hashCode()Delegate directly to superclass. @see #equals(Object)- Specified by:
hashCode
in interfaceCollection<D>
- Specified by:
hashCode
in interfaceSet<D>
- Overrides:
hashCode
in classAbstractSet<D>
-
add
- Specified by:
add
in interfaceCollection<D>
- Specified by:
add
in interfaceSet<D>
- Overrides:
add
in classAbstractCollection<D>
-
capacity
public int capacity() -
size
public int size()- Specified by:
size
in interfaceCollection<D>
- Specified by:
size
in interfaceSet<D>
- Specified by:
size
in classAbstractCollection<D>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<D>
- Specified by:
clear
in interfaceSet<D>
- Overrides:
clear
in classAbstractCollection<D>
-
iterator
-
remove
- Specified by:
remove
in interfaceCollection<D>
- Specified by:
remove
in interfaceSet<D>
- Overrides:
remove
in classAbstractCollection<D>
-
any
Get one arbitrarily chosen element and remove it.
(This is an dditional method not in the "java.util.Set" interface.) -
forEach
Apply code to all elements.
-