|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cesilko.rachota.gui.LimitedCapacityStack
public class LimitedCapacityStack
Stack with ability to keep only limited number of objects. Object is stored only if there is another object with smaller key or some capacity left.
Constructor Summary | |
---|---|
LimitedCapacityStack(int capacity)
Creates new instance of stack with given capacity. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LimitedCapacityStack(int capacity)
capacity
- Maximum number of objects to be stored in stack.Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |