Package com.nomagic.uml2.ext.jmi
Class OptimizedForSingleValueSet<T>
- java.lang.Object
-
- com.nomagic.uml2.ext.jmi.OptimizedForSingleValueSet<T>
-
- Direct Known Subclasses:
ModelPropertyChangeListeners.ListenerContainer,ModelPropertyChangeListeners.ListenerContainerSet
public abstract class OptimizedForSingleValueSet<T> extends java.lang.ObjectThe set with optimized memory usage for storing a single value.
-
-
Constructor Summary
Constructors Constructor Description OptimizedForSingleValueSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanadd(T object)Add object to setbooleanisEmpty()protected abstract T[]newArray(int length)booleanremove(T object)Remove object from setT[]toArray()
-
-
-
Method Detail
-
add
public boolean add(T object)
Add object to set- Parameters:
object- object- Returns:
- true if object was added to a set
-
remove
public boolean remove(T object)
Remove object from set- Parameters:
object- object- Returns:
- true if object was removed from the set
-
isEmpty
public boolean isEmpty()
- Returns:
- true if set is empty
-
toArray
public T[] toArray()
- Returns:
- values as array (not a copy array!)
-
newArray
protected abstract T[] newArray(int length)
-
-