|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractCollection<E>
AbstractList<E>
ArrayList
Walk
public class Walk
Represents a walk in a graph. A walk W is defined as an ordered set
of nodes that two adjacenct nodes in the set share
an edge. More precisley:
G = {N,E}
W = { n(i) in N | (n(i-1),n(i)) in E }
| Field Summary |
|---|
| Fields inherited from class AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
Walk()
|
|
Walk(Collection nodes)
|
|
| Method Summary | |
|---|---|
void |
add(int index,
Object element)
|
boolean |
add(Node node)
Adds a node to the walk. |
boolean |
add(Object o)
|
boolean |
addAll(Collection c)
|
boolean |
addAll(int index,
Collection c)
|
boolean |
addEdge(Edge e)
|
void |
addEdges(Collection edges)
|
protected List |
buildEdges()
Internal method for building the edge set of the walk. |
Path |
duplicate()
|
boolean |
equals(Object other)
|
boolean |
equals(Walk other)
|
List |
getEdges()
Calculates the edges in the walk. |
Node |
getFirst()
Returns the first node in the sequence. |
Node |
getLast()
Returns the last node in the sequence. |
int |
hashCode()
|
boolean |
isClosed()
Determines if the walk is closed. |
boolean |
isValid()
A valid walk is one in which each pair of adjacent nodes in the sequence share an edge. |
Object |
remove(int index)
|
void |
remove(Node node)
Removes a node from the walk. |
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
void |
reverse()
Reverses the path. |
Iterator |
riterator()
Returns an iterator that iterates over the path in reverse. |
void |
truncate(int index)
Truncates the path at the specified index. |
| Methods inherited from class ArrayList |
|---|
clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class AbstractList |
|---|
iterator, listIterator, listIterator, subList |
| Methods inherited from class AbstractCollection |
|---|
containsAll, retainAll, toString |
| Methods inherited from class Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface NodeSequence |
|---|
iterator, size |
| Methods inherited from interface List |
|---|
containsAll, iterator, listIterator, listIterator, retainAll, subList |
| Constructor Detail |
|---|
public Walk()
public Walk(Collection nodes)
| Method Detail |
|---|
public boolean isValid()
isValid in interface NodeSequencepublic List getEdges()
public boolean add(Node node)
node - Node to add to the walk.
public void add(int index,
Object element)
add in interface Listadd in class ArrayListpublic boolean add(Object o)
add in interface Collectionadd in interface Listadd in class ArrayListpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface ListaddAll in class ArrayList
public boolean addAll(int index,
Collection c)
addAll in interface ListaddAll in class ArrayListpublic boolean addEdge(Edge e)
public void addEdges(Collection edges)
public void remove(Node node)
node - Node to remove from the walk.public Object remove(int index)
remove in interface Listremove in class ArrayListpublic boolean remove(Object o)
remove in interface Collectionremove in interface Listremove in class ArrayListpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface ListremoveAll in class AbstractCollectionpublic boolean isClosed()
public Node getFirst()
NodeSequence
getFirst in interface NodeSequenceNodeSequence.getFirst()public Node getLast()
NodeSequence
getLast in interface NodeSequenceNodeSequence.getLast()protected List buildEdges()
public void reverse()
public void truncate(int index)
index - The index of first node to be removed.public Iterator riterator()
public Path duplicate()
public boolean equals(Object other)
equals in interface Collectionequals in interface Listequals in class AbstractListpublic boolean equals(Walk other)
public int hashCode()
hashCode in interface CollectionhashCode in interface ListhashCode in class AbstractList
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||