|
||||||||||
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 NodeSequence
public List getEdges()
public boolean add(Node node)
node
- Node to add to the walk.public void add(int index, Object element)
add
in interface List
add
in class ArrayList
public boolean add(Object o)
add
in interface Collection
add
in interface List
add
in class ArrayList
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
addAll
in class ArrayList
public boolean addAll(int index, Collection c)
addAll
in interface List
addAll
in class ArrayList
public 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 List
remove
in class ArrayList
public boolean remove(Object o)
remove
in interface Collection
remove
in interface List
remove
in class ArrayList
public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface List
removeAll
in class AbstractCollection
public boolean isClosed()
public Node getFirst()
NodeSequence
getFirst
in interface NodeSequence
NodeSequence.getFirst()
public Node getLast()
NodeSequence
getLast
in interface NodeSequence
NodeSequence.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 Collection
equals
in interface List
equals
in class AbstractList
public boolean equals(Walk other)
public int hashCode()
hashCode
in interface Collection
hashCode
in interface List
hashCode
in class AbstractList
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |