public class LimitedCapacityStack
extends java.lang.Object
| Constructor and Description |
|---|
LimitedCapacityStack(int capacity)
Creates new instance of stack with given capacity.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Vector |
getKeys()
Returns set of stored keys.
|
java.util.Vector |
getObjects()
Returns set of stored objects.
|
void |
put(java.lang.Comparable key,
java.lang.Object object)
Tries to store given object using provided key.
|
public LimitedCapacityStack(int capacity)
capacity - Maximum number of objects to be stored in stack.public void put(java.lang.Comparable key,
java.lang.Object object)
key - Key to be compared with the stored keys.object - Object that wants to be stored in the stack.public java.util.Vector getKeys()
public java.util.Vector getObjects()