View Javadoc

    1   package baseCode.dataStructure;
    2
    3   import java.text.NumberFormat;
    4
    5   /***
    6    * <p>
    7    * Title:
    8    * </p>
    9    * <p>
    10   * Description:
    11   * </p>
    12   * <p>
    13   * Copyright (c) 2004
    14   * </p>
    15   * <p>
    16   * Institution:: Columbia University
    17   * </p>
    18   *
    19   * @author Paul Pavlidis
    20   * @version $Id: Link.java,v 1.6 2004/07/27 03:18:58 pavlidis Exp $
    21   */
    22
    23  public class Link extends Point {
    24
    25     private double weight;
    26
    27     /***
    28      * @param i int
    29      * @param j int
    30      * @param weight double
    31      */
    32     public Link( int i, int j, double weight ) {
    33        super( i, j );
    34        this.weight = weight;
    35     }
    36
    37     /***
    38      * @return double
    39      */
    40     public double getWeight() {
    41        return weight;
    42     }
    43
    44     /***
    45      * @return java.lang.String
    46      */
    47     public String toString() {
    48        return super.toString() + "\t"
    49              + NumberFormat.getInstance().format( this.weight );
    50     }
    51
    52  }