Package eu.bandm.tools.ops
Class RtArraySet<D>
java.lang.Object
java.util.AbstractCollection<D>
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
removeAllMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, retainAll, toArray, toArray, toStringMethods 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 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:
equalsin interfaceCollection<D>- Specified by:
equalsin interfaceSet<D>- Overrides:
equalsin classAbstractSet<D>
-
hashCode
public int hashCode()Delegate directly to superclass. @see #equals(Object)- Specified by:
hashCodein interfaceCollection<D>- Specified by:
hashCodein interfaceSet<D>- Overrides:
hashCodein classAbstractSet<D>
-
add
- Specified by:
addin interfaceCollection<D>- Specified by:
addin interfaceSet<D>- Overrides:
addin classAbstractCollection<D>
-
capacity
public int capacity() -
size
public int size()- Specified by:
sizein interfaceCollection<D>- Specified by:
sizein interfaceSet<D>- Specified by:
sizein classAbstractCollection<D>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<D>- Specified by:
clearin interfaceSet<D>- Overrides:
clearin classAbstractCollection<D>
-
iterator
-
remove
- Specified by:
removein interfaceCollection<D>- Specified by:
removein interfaceSet<D>- Overrides:
removein 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.
-