DRCL J-Sim API

drcl.net.graph
Class Link

java.lang.Object
  extended bydrcl.net.graph.Link

public class Link
extends java.lang.Object

The class defines data structure that describes an "edge" of a graph. It can be directional or un-directional. A link may be "marked" for general purpose.


Constructor Summary
Link()
           
Link(int id_, Node n1_, int n1InterfaceId_, Node n2_, int n2InterfaceId_)
           
Link(int id_, Node n1_, int n1InterfaceId_, Node n2_, int n2InterfaceId_, boolean directional_)
           
Link(int id_, Node n1_, int n1InterfaceId_, Node n2_, int n2InterfaceId_, double cost_)
           
Link(int id_, Node n1_, int n1InterfaceId_, Node n2_, int n2InterfaceId_, double cost_, boolean directional_)
           
Link(int id_, Node n1_, int n1InterfaceId_, Node n2_, int n2InterfaceId_, double cost_, double len_)
           
Link(int id_, Node n1_, int n1InterfaceId_, Node n2_, int n2InterfaceId_, double cost_, double len_, boolean directional_)
           
Link(int id_, Node n1_, Node n2_)
           
Link(int id_, Node n1_, Node n2_, boolean directional_)
           
Link(int id_, Node n1_, Node n2_, double cost_, double len_)
           
Link(int id_, Node n1_, Node n2_, double cost_, double len_, boolean directional_)
           
 
Method Summary
 void disconnect()
          Removes itself from both end nodes.
 double getCost()
          Returns the link cost.
 int getID()
           
 int getInterfaceId(Node n)
          Returns the interface Id of this link on node n.
 double getLength()
          Returns the length of the link.
 boolean isDirectional()
          Returns true if it is a directional link.
 boolean isMarked()
          Returns true if this link is marked.
 Node neighbor(Node n)
          Returns n's neighbor node thru this link.
 Node[] nodes()
          Returns the end nodes of this link.
 void setCost(double cost_)
          Sets the link cost.
 void setLength(double len_)
          Sets the length of the link.
 void setMarked(boolean marked_)
          Mark/unmark this link.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Link

public Link()

Link

public Link(int id_,
            Node n1_,
            Node n2_)

Link

public Link(int id_,
            Node n1_,
            Node n2_,
            boolean directional_)

Link

public Link(int id_,
            Node n1_,
            int n1InterfaceId_,
            Node n2_,
            int n2InterfaceId_)

Link

public Link(int id_,
            Node n1_,
            int n1InterfaceId_,
            Node n2_,
            int n2InterfaceId_,
            boolean directional_)

Link

public Link(int id_,
            Node n1_,
            int n1InterfaceId_,
            Node n2_,
            int n2InterfaceId_,
            double cost_)

Link

public Link(int id_,
            Node n1_,
            int n1InterfaceId_,
            Node n2_,
            int n2InterfaceId_,
            double cost_,
            boolean directional_)

Link

public Link(int id_,
            Node n1_,
            Node n2_,
            double cost_,
            double len_)

Link

public Link(int id_,
            Node n1_,
            Node n2_,
            double cost_,
            double len_,
            boolean directional_)

Link

public Link(int id_,
            Node n1_,
            int n1InterfaceId_,
            Node n2_,
            int n2InterfaceId_,
            double cost_,
            double len_)

Link

public Link(int id_,
            Node n1_,
            int n1InterfaceId_,
            Node n2_,
            int n2InterfaceId_,
            double cost_,
            double len_,
            boolean directional_)
Method Detail

getID

public int getID()

nodes

public Node[] nodes()
Returns the end nodes of this link.


neighbor

public Node neighbor(Node n)
Returns n's neighbor node thru this link. n must be one of the end nodes.


getInterfaceId

public int getInterfaceId(Node n)
Returns the interface Id of this link on node n. n must be one of the end nodes.


getCost

public double getCost()
Returns the link cost.


setCost

public void setCost(double cost_)
Sets the link cost.


getLength

public double getLength()
Returns the length of the link.


setLength

public void setLength(double len_)
Sets the length of the link.


disconnect

public void disconnect()
Removes itself from both end nodes.


setMarked

public void setMarked(boolean marked_)
Mark/unmark this link.


isMarked

public boolean isMarked()
Returns true if this link is marked.


isDirectional

public boolean isDirectional()
Returns true if it is a directional link.


toString

public java.lang.String toString()

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~