|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgoanim.primitives.Primitive
algoanim.primitives.VisualStack<T>
public abstract class VisualStack<T>
Base abstract class for all the (LIFO-)stacks in animalscriptapi.primitives.
VisualStack represents the common visual features of all the subclasses
and manges the actual data using an internal java.util.Stack.
The stored objects are of the generic data type T, so it is generally possible
to use VisualStack with any objects.
ConceptualStack,
ArrayBasedStack,
ListBasedStack| Field Summary |
|---|
| Fields inherited from class algoanim.primitives.Primitive |
|---|
gen |
| Constructor Summary | |
|---|---|
VisualStack(GeneratorInterface g,
Node upperLeftCorner,
java.util.List<T> content,
java.lang.String name,
DisplayOptions display,
StackProperties sp)
Constructor of the VisualStack. |
|
| Method Summary | |
|---|---|
java.util.List<T> |
getInitContent()
Returns the initial content of the stack. |
StackProperties |
getProperties()
Returns the properties of the stack. |
java.util.Stack<T> |
getStack()
Returns the internal java.util.Stack. |
Node |
getUpperLeft()
Returns the upper left corner of the stack. |
boolean |
isEmpty()
Tests if the stack is empty. |
T |
pop()
Removes and returns the element at the top of the stack. |
void |
push(T elem)
Pushes the element elem onto the top of the stack. |
void |
setName(java.lang.String newName)
Sets the name of this Primitive. |
T |
top()
Retrieves (without removing) the element at the top of the stack. |
| Methods inherited from class algoanim.primitives.Primitive |
|---|
changeColor, exchange, getDisplayOptions, getName, hide, hide, moveBy, moveTo, moveVia, rotate, rotate, show, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VisualStack(GeneratorInterface g,
Node upperLeftCorner,
java.util.List<T> content,
java.lang.String name,
DisplayOptions display,
StackProperties sp)
VisualStack.
g - the appropriate code Generator.upperLeftCorner - the upper left corner of this VisualStack.content - the initial content of the VisualStack, consisting
of the elements of the generic type T.name - the name of this VisualStack.display - [optional] the DisplayOptions of this VisualStack.sp - [optional] the properties of this VisualStack.| Method Detail |
|---|
public void push(T elem)
elem onto the top of the stack. Unlike the
push-method of java.util.Stack it doesn't return
the element to be pushed.
elem - the element to be pushed onto the stack.Stack.push(Object)public T pop()
Stack.pop()public T top()
Stack.peek()public boolean isEmpty()
true if and only if the stack contains no elements;
false otherwise.Stack.empty()public Node getUpperLeft()
public void setName(java.lang.String newName)
PrimitivePrimitive.
setName in class PrimitivenewName - the new name for this Primitive.Primitive.setName(java.lang.String)public StackProperties getProperties()
public java.util.Stack<T> getStack()
java.util.Stack.
java.util.Stack.public java.util.List<T> getInitContent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||