org.samcrow
Class Link

java.lang.Object
  extended by org.samcrow.Link

public class Link
extends java.lang.Object


Field Summary
static double DEFAULT_SPEED
           
private  double distance
           
private  Node end
           
private  double speed
           
private  Node start
           
 
Constructor Summary
Link(Node node1, Node node2, double inSpeed)
           
 
Method Summary
 double distance()
          Get the distance of this link
 Node endNode()
          Get the start node of this link
 boolean equals(java.lang.Object obj)
           
 org.lekan.graphics.SGObject getDrawObject()
          Get the SGObject that should be drawn to represent this link
 org.lekan.graphics.SGText getLabel()
          Get the SGText SGObject to display the label for this Link
 int hashCode()
           
 double speed()
          Get the speed of this link
 Node startNode()
          Get the start node of this link
 double time()
          Get the time in seconds taken to traverse this link
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SPEED

public static final double DEFAULT_SPEED
See Also:
Constant Field Values

start

private Node start

end

private Node end

distance

private double distance

speed

private double speed
Constructor Detail

Link

public Link(Node node1,
            Node node2,
            double inSpeed)
Method Detail

speed

public double speed()
Get the speed of this link

Returns:
the speed

time

public double time()
Get the time in seconds taken to traverse this link

Returns:
the time in seconds

distance

public double distance()
Get the distance of this link

Returns:
the number of pixels in the length of this link

startNode

public Node startNode()
Get the start node of this link

Returns:
the start node

endNode

public Node endNode()
Get the start node of this link

Returns:
the start node

getDrawObject

public org.lekan.graphics.SGObject getDrawObject()
Get the SGObject that should be drawn to represent this link

Returns:
the SGObject, currently an SGLine, to be drawn

getLabel

public org.lekan.graphics.SGText getLabel()
Get the SGText SGObject to display the label for this Link

Returns:
the SGText object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object