|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnct.graph.basic.BasicEdge<NodeType,WeightType>
public class BasicEdge<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
A generic implementation of the Edge interface.
Field Summary | |
---|---|
protected java.lang.String |
description
The edge description. |
protected NodeType |
sourceNode
The source node of the edge. |
protected NodeType |
targetNode
The target node of the edge. |
protected WeightType |
weight
The edge weight. |
Constructor Summary | |
---|---|
BasicEdge(NodeType sourceNode,
NodeType targetNode,
WeightType weight)
|
|
BasicEdge(NodeType sourceNode,
NodeType targetNode,
WeightType weight,
java.lang.String desc)
|
Method Summary | |
---|---|
int |
compareTo(Edge<NodeType,WeightType> e)
First compares whether the source and target nodes are the same and if so assumes the edge is the same. |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getDescription()
|
NodeType |
getSourceNode()
|
NodeType |
getTargetNode()
|
WeightType |
getWeight()
|
int |
hashCode()
|
void |
setDescription(java.lang.String desc)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected NodeType extends java.lang.Comparable<? super NodeType> sourceNode
protected NodeType extends java.lang.Comparable<? super NodeType> targetNode
protected WeightType extends java.lang.Comparable<? super WeightType> weight
protected java.lang.String description
Constructor Detail |
---|
public BasicEdge(NodeType sourceNode, NodeType targetNode, WeightType weight, java.lang.String desc)
sourceNode
- The source node of the edge.targetNode
- The target node of the edge.weight
- The edge weight.desc
- The edge description.public BasicEdge(NodeType sourceNode, NodeType targetNode, WeightType weight)
sourceNode
- The source node of the edge.targetNode
- The target node of the edge.weight
- The edge weight.Method Detail |
---|
public WeightType getWeight()
getWeight
in interface Edge<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
public void setDescription(java.lang.String desc)
setDescription
in interface Edge<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
desc
- The description of the edge.public java.lang.String getDescription()
getDescription
in interface Edge<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
public int compareTo(Edge<NodeType,WeightType> e)
compareTo
in interface java.lang.Comparable<Edge<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>>
e
- The other edge to compare against this one.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The edge to compare against this one.
public int hashCode()
hashCode
in class java.lang.Object
public NodeType getSourceNode()
getSourceNode
in interface Edge<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
public NodeType getTargetNode()
getTargetNode
in interface Edge<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |