livespace.services
Class EntityStack
java.lang.Object
dsto.dfc.databeans.AbstractDataObject
dsto.dfc.databeans.SimpleDataObject
dsto.dfc.databeans.FancyDataObject
livespace.services.EntityList
livespace.services.EntityStack
- All Implemented Interfaces:
- IDataObject, IDataObjectChildListener, Cloneable
public class EntityStack
- extends EntityList
A last-in-first-out stack of entities. This extends
EntityList
with operations that allow the list to be treated
as a stack.
- Author:
- Steven Johnson Created on 17/05/2006
Method Summary |
Entity |
peek()
Finds the top entity on the stack without removing it from the stack. |
Entity |
pop()
Removes and returns the Entity at the top of the stack. |
void |
push(Entity e)
Pushes an Entity on to the top of stack. |
Methods inherited from class livespace.services.EntityList |
add, add, clear, get, isEmpty, iterator, remove, remove, remove, size, snapshot |
Methods inherited from class dsto.dfc.databeans.AbstractDataObject |
addFirstPropertyListener, addPropertyListener, firePropertyChangedEvent, firePropertyChangedEvent, firePropertyChangedEvent, firePropertyChangedEvent, firePropertyChangedEvent, firePropertyChangedEvent, getBeanValue, getBooleanValue, getBooleanValue, getCharValue, getCharValue, getDoubleValue, getDoubleValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getObjectValue, getPropertyListeners, getShortValue, getStringValue, registerValue, removePropertyListener, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toString, unregisterValue |
EntityStack
public EntityStack()
peek
public Entity peek()
throws IllegalStateException
- Finds the top entity on the stack without removing it from the stack.
- Returns:
- the Entity at the top of the stack.
- Throws:
IllegalStateException
- if the stack is empty
pop
public Entity pop()
throws IllegalStateException
- Removes and returns the Entity at the top of the stack.
- Returns:
- the Entity at the top of the stack
- Throws:
IllegalStateException
- if the stack is empty
push
public void push(Entity e)
- Pushes an Entity on to the top of stack.
- Parameters:
e
- the Entity to put at the top of the stack.
Copyright © 2008 Commonwealth of Australia