|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectexe.GAIGSbase
exe.GAIGSlist
public class GAIGSlist
GAIGSlist provides the ability to implement a linked list and also
create GAIGS visualizations of its state. Use the various constructors
to specify the general parameters for the list visualization, and use the
toXML method to actually generate the array XML for snapshots.
Many, but not all, of the methods specified by the List interface are
provided by this class.
Methods are also provided to set and get the presentation color of a list cell. A default list cell color can be set by using the appropriate constructor.
Known inheriters: GAIGSstack, GAIGSqueue.
| Field Summary |
|---|
| Fields inherited from interface exe.GAIGSdatastr |
|---|
DEFAULT_COLOR, DEFAULT_FONT_SIZE, DEFAULT_NAME, DEFAULT_X1, DEFAULT_X2, DEFAULT_Y1, DEFAULT_Y2 |
| Constructor Summary | |
|---|---|
GAIGSlist()
Use all default values |
|
GAIGSlist(java.lang.String name,
java.lang.String color,
double x1,
double y1,
double x2,
double y2,
double fontSize)
Set all instance variables |
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object v)
Inserts the specified element at the specified position in this list. |
void |
add(int index,
java.lang.Object v,
java.lang.String c)
Inserts the specified element at the specified position in this list with the provided color. |
boolean |
add(java.lang.Object v)
Appends the specified element to the end of this list. |
boolean |
add(java.lang.Object v,
java.lang.String c)
Appends the specified element to the end of this list with the provided color. |
void |
addFirst(java.lang.Object v)
Inserts the given element at the beginning of this list. |
void |
addFirst(java.lang.Object v,
java.lang.String c)
Inserts the given element at the beginning of this list with the provided color. |
void |
addLast(java.lang.Object v)
Inserts the given element at the end of this list. |
void |
addLast(java.lang.Object v,
java.lang.String c)
Inserts the given element at the end of this list with the provided color. |
void |
clear()
Removes all of the elements from this list. |
boolean |
contains(java.lang.Object v)
Returns true if this list contains the specified element. |
java.lang.Object |
get(int index)
Returns the element at the specified position in this list. |
java.lang.String |
getColor(int index)
Returns the color of the element at the specified position in this list. |
java.lang.Object |
getFirst()
Returns the first element in this list. |
java.lang.Object |
getLast()
Returns the first element in this list. |
int |
indexOf(java.lang.Object v)
Returns the index in this list of the first occurrence of the specified element, or -1 if the List does not contain this element. |
boolean |
isEmpty()
Returns true if the list is empty. |
int |
lastIndexOf(java.lang.Object v)
Returns the index in this list of the last occurrence of the specified element, or -1 if the List does not contain this element. |
java.lang.Object |
remove(int index)
Removes and return the element at the specified position in this list. |
boolean |
remove(java.lang.Object o)
Removes the first occurrence of the specified element in this list. |
java.lang.Object |
removeFirst()
Remove and returns the first item in the list. |
java.lang.Object |
removeLast()
Remove and returns the last item in the list. |
java.lang.Object |
set(int index,
java.lang.Object v)
Set the specified location with the element with the default color. |
java.lang.Object |
set(int index,
java.lang.Object v,
java.lang.String c)
Set the specified location with the element with the provided color. |
void |
setColor(int index,
java.lang.String c)
Set the color of the element at the specified location. |
int |
size()
Return the number of items in the list. |
java.lang.String |
toXML()
Creates and returns GAIGS XML code for the current state of the linked list |
java.lang.String |
toXML(java.lang.String s)
Creates and returns GAIGS XML code for the current state of the linear structure named by the parameter string. |
| 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 |
| Constructor Detail |
|---|
public GAIGSlist()
public GAIGSlist(java.lang.String name,
java.lang.String color,
double x1,
double y1,
double x2,
double y2,
double fontSize)
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 boolean add(java.lang.Object v)
v - The value to be stored.
public boolean add(java.lang.Object v,
java.lang.String c)
v - The value to be stored.c - The color to be stored.
public void add(int index,
java.lang.Object v)
v - The value to be stored.
public void add(int index,
java.lang.Object v,
java.lang.String c)
v - The value to be stored.c - The color to be stored.public void addFirst(java.lang.Object v)
v - The value to be stored.
public void addFirst(java.lang.Object v,
java.lang.String c)
v - The value to be stored.c - The color to be stored.public void addLast(java.lang.Object v)
v - The value to be stored.
public void addLast(java.lang.Object v,
java.lang.String c)
v - The value to be stored.c - The color to be stored.public void clear()
public boolean contains(java.lang.Object v)
v - The value to be searched for.public java.lang.Object get(int index)
index - The location to be accessed.public java.lang.String getColor(int index)
index - The location to be accessed.public java.lang.Object getFirst()
public java.lang.Object getLast()
public int indexOf(java.lang.Object v)
v - The value to be searched for.public boolean isEmpty()
public int lastIndexOf(java.lang.Object v)
v - The value to be searched for.public java.lang.Object remove(int index)
index - The location to be accessed.public boolean remove(java.lang.Object o)
o - The object to be removed.public java.lang.Object removeFirst()
public java.lang.Object removeLast()
public java.lang.Object set(int index,
java.lang.Object v)
index - The location to be accessed.v - The value to be stored.
public java.lang.Object set(int index,
java.lang.Object v,
java.lang.String c)
index - The location to be accessed.v - The value to be stored.c - The color to be stored.
public void setColor(int index,
java.lang.String c)
index - The location to be accessed.c - The color to be stored.public int size()
public java.lang.String toXML()
public java.lang.String toXML(java.lang.String s)
s - The linear structure type name
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||