|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.cke.graph.VertexList
A VertexList encapsulates a list of vertices. It can hold as many vertices as needed.
Vector
,
Serialized FormField Summary | |
protected java.util.Vector |
vertices
List of vertices. |
Constructor Summary | |
VertexList()
No-arg constructor; creates the vector to hold the list of vertices. |
|
VertexList(VisualEntity[] veList)
creates the vector to hold the list of vertices. |
Method Summary | |
void |
add(VisualEntity node)
Add a new VisualEntity to this list. |
void |
clear()
Removes all of the vertices from the list. |
java.lang.Object |
clone()
Creates a shallow copy of this VisualEntity list, cloning the list of the vertices into the new object. |
VertexList |
copy()
Makes a deep copy of this vertex list, cloning each of the vertices in the list. |
VisualEntity |
get(int index)
Get the VisualEntity stored at the specified index in the list. |
int |
indexOf(VisualEntity node)
Find the index of the element in the list. |
void |
join(VertexList list)
Combines the elements from list into this
list of vertices. |
boolean |
remove(int nodeToRemove)
Removes the specified element from the list given the index of the VisualEntity within the list. |
boolean |
remove(VisualEntity nodeToRemove)
Removes the specified element from the list given the VisualEntity itself. |
int |
size()
Returns the size of the vertex list. |
boolean |
verify()
Error-checking method that verifies the data and structure of the vertex list object. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector vertices
Constructor Detail |
public VertexList()
public VertexList(VisualEntity[] veList)
Method Detail |
public void add(VisualEntity node)
node
- new VisualEntity to add to listpublic void clear()
public java.lang.Object clone()
public VertexList copy()
public VisualEntity get(int index)
index
- number of the nth VisualEntity to get (0-based)
public int indexOf(VisualEntity node)
node
- VisualEntity to search for
public void join(VertexList list)
list
into this
list of vertices. Vertices in list
will only
be added if there is nothing similar in our list.
list
- list of vertices to addpublic boolean remove(VisualEntity nodeToRemove)
nodeToRemove
- VisualEntity to remove from list
public boolean remove(int nodeToRemove)
nodeToRemove
- index of VisualEntity to remove from list
public int size()
public boolean verify()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |