|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectexe.GAIGSbase
exe.GAIGSlist
exe.GAIGSnewStack
public class GAIGSnewStack
GAIGSnewStack extends the GAIGSlist class, providing
the ability to implement a standard stack data structure and also create GAIGS
visualizations of its state. Use the various constructors to specify the general
parameters for the stack visualization, and use the toXML method to
actually generate the stack XML for snapshots.
A method is also provided to set the presentation color of a stack cell.
A default stack cell color can be set by using the appropriate constructor.
Methods to get a cell color are inherited from GAIGSlist.
| Nested Class Summary | |
|---|---|
protected class |
GAIGSnewStack.BoxPair
|
| Field Summary | |
|---|---|
protected java.util.LinkedList<GAIGSnewStack.BoxPair> |
deltaArray
ArrayList for keeping track of width and size requirements |
| Fields inherited from interface exe.GAIGSdatastr |
|---|
DEFAULT_COLOR, DEFAULT_FONT_SIZE, DEFAULT_NAME, DEFAULT_X1, DEFAULT_X2, DEFAULT_Y1, DEFAULT_Y2 |
| Constructor Summary | |
|---|---|
GAIGSnewStack()
Use all default values for instance variables |
|
GAIGSnewStack(java.lang.String name,
java.lang.String color,
double x1,
double y1,
double x2,
double y2)
Explicitly set all instance variables. |
|
| Method Summary | |
|---|---|
double[] |
getCornerPoints(int e)
Get the corner points making up the box around the element |
java.lang.Object |
peek()
returns but does not remove an item from the stack. |
java.lang.Object |
pop()
removes an item from the stack and returns it. |
void |
push(java.lang.Object v)
Adds an item to the stack. |
void |
push(java.lang.Object v,
java.lang.String c)
Adds an item with an associated color to the stack. |
java.lang.String |
toXML()
Creates and returns GAIGS XML code for the current state of the stack |
| Methods inherited from class exe.GAIGSlist |
|---|
add, add, add, add, addFirst, addFirst, addLast, addLast, clear, contains, get, getColor, getFirst, getLast, indexOf, isEmpty, lastIndexOf, remove, remove, removeFirst, removeLast, set, set, setColor, size, toXML |
| Methods inherited from class exe.GAIGSbase |
|---|
getName, setName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.LinkedList<GAIGSnewStack.BoxPair> deltaArray
| Constructor Detail |
|---|
public GAIGSnewStack()
public GAIGSnewStack(java.lang.String name,
java.lang.String color,
double x1,
double y1,
double x2,
double y2)
name - Display name of this structure.color - Color for items unless locally overridden.x1 - Left display bound.y1 - Bottom display bound.x2 - Top display bound.y2 - Right display bound.fontSize - Font size for display.| Method Detail |
|---|
public void push(java.lang.Object v)
v - The value to be stored.
public void push(java.lang.Object v,
java.lang.String c)
v - The value to be stored.c - The display color for this item.public java.lang.Object pop()
Object containing popped valuepublic java.lang.Object peek()
Object containing the next value to be popped.public double[] getCornerPoints(int e)
e - the element
public java.lang.String toXML()
toXML in interface GAIGSdatastrtoXML in class GAIGSlistString containing GAIGS XML code for the stack
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||