|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectps3.graph.NodeCountingPath
public class NodeCountingPath
A NodeCountingPath characterizes a path of WeightedNodes. The cost for a path is the number of WeightedNodes it contains; the cost of the WeightedNodes are ignored.
A NodeCountingPath is immutable. A new NodeCountingPath is returned through the extend path operation.
The main purpose of this class is to illustrate that there can be multiple implementations of Paths of WeightedNodes.
Specfields inherited from Path:
cost - : double // cost of traversing this path.
elements - : sequence // sequence of nodes in this path.
| Constructor Summary | |
|---|---|
NodeCountingPath(WeightedNode node)
Constructs a NodeCountingPath containing one node. |
|
| Method Summary | |
|---|---|
int |
compareTo(Path<?,?> p)
Compares the cost of this path to the given path. |
double |
cost()
|
WeightedNode |
end()
Return the end of this path |
boolean |
equals(NodeCountingPath wnp)
|
boolean |
equals(Object o)
|
NodeCountingPath |
extend(WeightedNode node)
Creates an extended path by adding a new node to its end. |
int |
hashCode()
|
Iterator<WeightedNode> |
iterator()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NodeCountingPath(WeightedNode node)
node.| Method Detail |
|---|
public NodeCountingPath extend(WeightedNode node)
Path
extend in interface Path<WeightedNode,NodeCountingPath>public double cost()
cost in interface Path<WeightedNode,NodeCountingPath>public Iterator<WeightedNode> iterator()
iterator in interface Iterable<WeightedNode>iterator in interface Path<WeightedNode,NodeCountingPath>public String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Objectpublic boolean equals(NodeCountingPath wnp)
public int hashCode()
hashCode in class Objectpublic int compareTo(Path<?,?> p)
compareTo in interface Comparable<Path<?,?>>Comparable.compareTo(T)public WeightedNode end()
end in interface Path<WeightedNode,NodeCountingPath>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||