public class RecomputeStack<Key,Value>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RecomputeStack.StackElement<Key,Value> |
Constructor and Description |
---|
RecomputeStack() |
Modifier and Type | Method and Description |
---|---|
RecomputeStack.StackElement<Key,Value> |
pop()
Pops the element on the top of the stack, removing it.
|
RecomputeStack.StackElement<Key,Value> |
push(Key key,
Value value)
Complex operation, if the key is not present, it will create at the beginning of the stack, a new element with the value
If the key is present, it will be pushed to the bottom of the stack and the existing element is returned unchanged
|
public RecomputeStack.StackElement<Key,Value> push(Key key, Value value)
key
- value
- public RecomputeStack.StackElement<Key,Value> pop()