|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.avltree.SingletonOrOrderedSet<V>
public class SingletonOrOrderedSet<V>
Stores either a single object or many of them in an AvlTree.
Constructor Summary | |
---|---|
SingletonOrOrderedSet(AvlTree<V> orderedSet)
Creates a new instance of SingletonOrOrderedSet with a set of ordered values. |
|
SingletonOrOrderedSet(V singleton)
Creates a new instance of SingletonOrOrderedSet with a singleton value. |
Method Summary | |
---|---|
AvlTree<V> |
getOrderedSet()
Gets the ordered set. |
V |
getSingleton()
Gets the singleton value. |
boolean |
isOrderedSet()
Gets whether or not the stored value is an ordered set. |
boolean |
isSingleton()
Gets whether or not the stored value is a singleton. |
AvlTree<V> |
setOrderedSet(AvlTree<V> orderedSet)
Sets the set of ordered values. |
V |
setSingleton(V singleton)
Sets the singleton if in singleton mode. |
V |
switchToOrderedSet(AvlTree<V> orderedSet)
Switches from orderedSet mode to singleton mode, while returning the singleton value before removing it forever. |
AvlTree<V> |
switchToSingleton(V singleton)
Switches from orderedSet mode to singleton mode, while returning the ordered set of values before removing them forever. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SingletonOrOrderedSet(V singleton)
singleton
- the singleton valuepublic SingletonOrOrderedSet(AvlTree<V> orderedSet)
orderedSet
- the set of ordered valuesMethod Detail |
---|
public boolean isSingleton()
public boolean isOrderedSet()
public V getSingleton()
java.lang.RuntimeException
- if not in singleton modepublic V setSingleton(V singleton)
singleton
- the singleton value to set
public AvlTree<V> switchToSingleton(V singleton)
singleton
- the singleton value
java.lang.RuntimeException
- if already in singleton modepublic AvlTree<V> getOrderedSet()
java.lang.RuntimeException
- if in singleton modepublic AvlTree<V> setOrderedSet(AvlTree<V> orderedSet)
orderedSet
- the set of ordered values to use
java.lang.RuntimeException
- if in singleton modepublic V switchToOrderedSet(AvlTree<V> orderedSet)
orderedSet
- the AvlTree to use for orderedSet of values
java.lang.RuntimeException
- if the mode is already in orderedSet mode.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |