|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnct.networkblast.PathGraph<NodeType>
public class PathGraph<NodeType extends java.lang.Comparable<? super NodeType>>
| Constructor Summary | |
|---|---|
PathGraph(NodeType n)
|
|
| Method Summary | |
|---|---|
boolean |
addEdge(NodeType nodeA,
NodeType nodeB,
java.lang.Double weight)
Adds an edge to the graph. |
boolean |
addEdge(NodeType nodeA,
NodeType nodeB,
java.lang.Double weight,
java.lang.String desc)
Adds an edge to the graph. |
boolean |
addNode(NodeType node)
Adds a node to the graph. |
java.lang.Object |
clone()
Returns a clone of this object. |
int |
compareTo(Graph<NodeType,java.lang.Double> g)
Compares graph g to this graph. |
int |
degreeOfNode(NodeType node)
Returns the degree (number of neighbors) of the node. |
Edge<NodeType,java.lang.Double> |
getEdge(NodeType nodeA,
NodeType nodeB)
Returns a specific edge. |
java.lang.String |
getEdgeDescription(NodeType nodeA,
NodeType nodeB)
Returns a description of the edge implied by the two specified nodes. |
java.util.List<Edge<NodeType,java.lang.Double>> |
getEdgeList()
|
java.util.Set<Edge<NodeType,java.lang.Double>> |
getEdges()
Returns all edges in the graph. |
java.lang.Double |
getEdgeWeight(NodeType nodeA,
NodeType nodeB)
Returns the weight of the edge implied by the two specified nodes. |
java.lang.String |
getId()
Returns the id of the graph. |
java.util.Set<NodeType> |
getNeighbors(NodeType node)
Returns a set all nodes adjacent to the specified node. |
java.util.Set<NodeType> |
getNodes()
Returns a set containing all nodes in the graph. |
java.lang.Double |
getScore()
Returns the score of the graph. |
boolean |
isEdge(NodeType nodeA,
NodeType nodeB)
Indicates whether the specified nodes refer to a valid edge in the graph. |
boolean |
isNode(NodeType node)
Indicates whether the specified nodes is contained in the graph. |
int |
numberOfEdges()
Returns the number of edges in the graph. |
int |
numberOfNodes()
Returns the number of nodes in the graph. |
boolean |
removeEdge(NodeType nodeA,
NodeType nodeB)
|
boolean |
removeNode(NodeType node)
|
boolean |
setEdgeDescription(NodeType nodeA,
NodeType nodeB,
java.lang.String desc)
Sets a description for the edge implied by the two specified nodes. |
boolean |
setEdgeWeight(NodeType nodeA,
NodeType nodeB,
java.lang.Double weight)
|
void |
setScore(java.lang.Double f)
Sets the score of the graph. |
java.lang.String |
toString()
Returns a String representation of the graph format. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PathGraph(NodeType n)
| Method Detail |
|---|
public boolean addNode(NodeType node)
Graph
addNode in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>node - The node to add.
public boolean addEdge(NodeType nodeA,
NodeType nodeB,
java.lang.Double weight)
Graph
addEdge in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>nodeA - The beginning node of the edge to add.nodeB - The ending node of the edge to add.weight - The edge weight.
public boolean addEdge(NodeType nodeA,
NodeType nodeB,
java.lang.Double weight,
java.lang.String desc)
Graph
addEdge in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>nodeA - The beginning node of the edge to add.nodeB - The ending node of the edge to add.weight - The edge weight.desc - The edge description.
public boolean isEdge(NodeType nodeA,
NodeType nodeB)
Graph
isEdge in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>nodeA - The beginning node of the edge to check.nodeB - The ending node of the edge to check.
public boolean isNode(NodeType node)
Graph
isNode in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>node - The node to check.
public java.lang.Double getEdgeWeight(NodeType nodeA,
NodeType nodeB)
Graph
getEdgeWeight in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>nodeA - The beginning node of the edge.nodeB - The ending node of the edge.
public java.util.Set<NodeType> getNodes()
Graph
getNodes in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>public java.util.Set<NodeType> getNeighbors(NodeType node)
Graph
getNeighbors in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>node - The node whose neighbors we're requesting.
public java.lang.String getId()
Graph
getId in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>public int numberOfNodes()
Graph
numberOfNodes in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>public int numberOfEdges()
Graph
numberOfEdges in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>public int degreeOfNode(NodeType node)
Graph
degreeOfNode in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>node - The node whose degree we're requesting.
public java.lang.Double getScore()
Graph
getScore in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>public void setScore(java.lang.Double f)
Graph
setScore in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>f - The score to set the graph to.public int compareTo(Graph<NodeType,java.lang.Double> g)
Graph
compareTo in interface java.lang.Comparable<Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>>compareTo in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>g - Graph to compare this graph to.
public java.lang.String getEdgeDescription(NodeType nodeA,
NodeType nodeB)
Graph
getEdgeDescription in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>nodeA - The beginning node of the edge.nodeB - The ending node of the edge.
public boolean setEdgeDescription(NodeType nodeA,
NodeType nodeB,
java.lang.String desc)
Graph
setEdgeDescription in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>nodeA - The source node of the edge.nodeB - The target node of the edge.desc - The description of the edge.
public Edge<NodeType,java.lang.Double> getEdge(NodeType nodeA,
NodeType nodeB)
Graph
getEdge in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>nodeA - The source node of the edge.nodeB - The target node of the edge.
public java.util.Set<Edge<NodeType,java.lang.Double>> getEdges()
Graph
getEdges in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>public java.util.List<Edge<NodeType,java.lang.Double>> getEdgeList()
getEdgeList in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>public java.lang.Object clone()
Graph
clone in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>clone in class java.lang.Objectpublic java.lang.String toString()
Graph
toString in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>toString in class java.lang.Object
public boolean removeEdge(NodeType nodeA,
NodeType nodeB)
removeEdge in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>public boolean removeNode(NodeType node)
removeNode in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>
public boolean setEdgeWeight(NodeType nodeA,
NodeType nodeB,
java.lang.Double weight)
setEdgeWeight in interface Graph<NodeType extends java.lang.Comparable<? super NodeType>,java.lang.Double>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||