|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectroboguice.inject.ContextScope.WeakActiveStack<T>
T
- public static class ContextScope.WeakActiveStack<T>
A circular stack like structure of weak references. Calls to push while not add any new items to stack if the item already exists, it will simply bring the item to the top of the stack. Likewise, pop will not remove the item from the stack, it will simply make the next item the top, move the current top to the bottom. Thus creating a circular linked list type effect. To remove an item explicitly call the remove method. The stack also holds WeakReferences of T, these references will automatically be removed anytime the stack accessed. For performance they are only removed as they are encountered. So it is possible to get a null value back, even though you thought the stack had items in it.
Constructor Summary | |
---|---|
ContextScope.WeakActiveStack()
|
Method Summary | |
---|---|
protected roboguice.inject.ContextScope.WeakActiveStack.Node<T> |
disposeOfNode(roboguice.inject.ContextScope.WeakActiveStack.Node<T> node)
Removes a node ensuring all links are properly updated. |
protected roboguice.inject.ContextScope.WeakActiveStack.Node<T> |
findNode(T value)
Finds a node given a value Will dispose of nodes if needed as it iterates the stack. |
T |
peek()
Non destructive read of the item at the top of stack. |
T |
pop()
Pops the first item off the stack, then moves it to the bottom. |
void |
push(T value)
Pushes the value onto the top of the stack. |
void |
remove(T value)
Removes the item from the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContextScope.WeakActiveStack()
Method Detail |
---|
public void push(T value)
value
- public T pop()
public T peek()
public void remove(T value)
value
- protected roboguice.inject.ContextScope.WeakActiveStack.Node<T> disposeOfNode(roboguice.inject.ContextScope.WeakActiveStack.Node<T> node)
node
-
protected roboguice.inject.ContextScope.WeakActiveStack.Node<T> findNode(T value)
value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |