weightededgeimpl.java
来自「OpenJGraph是一个开源的Java库」· Java 代码 · 共 44 行
JAVA
44 行
package salvo.jesus.graph;/** * Represents a weighted edge in a graph. * * @author Jesus M. Salvo Jr. */public class WeightedEdgeImpl extends EdgeImpl implements WeightedEdge{ /** * The weight of the edge. The implementation of the WeightedEdge interface * is delegated to this object. */ WeightedEdgeWeakImpl weightOfEdge; /** * Creates an WeightedEdgeImpl object. * * @see Vertex */ public WeightedEdgeImpl( Vertex a, Vertex b, double weight ) { super( a, b ); this.weightOfEdge = new WeightedEdgeWeakImpl( weight ); } /** * Returns the weight of the edge. */ public double getWeight() { return this.weightOfEdge.getWeight(); } /** * Sets the weight of the edge. * * @param weight The new weight of the edge */ public void setWeight( double weight ) { this.weightOfEdge.setWeight( weight ); } public String toString(){ return this.labelDelegator.getLabel(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?