Class DASOR_AdjMatrix

java.lang.Object
  extended by DASOR_AdjMatrix

public class DASOR_AdjMatrix
extends java.lang.Object


Constructor Summary
DASOR_AdjMatrix(int size)
          Default constructor
 
Method Summary
 void addNode()
           
 void delNode(int node)
          Delete the node.
 void empty()
          Empty the matrix
 DASOR_Link getLink(int node1, int node2)
           
 DASOR_Link getLinkClicked(double x, double y)
           
 int getSize()
          Return the size
 int getWeight(int node1, int node2)
          Return the weight between node 1 and node 2.
 boolean isLink(int node1, int node2)
          Return true if a link exists between the node1 and the node2, false otherwise.
 void setPos(DASOR_Node node1, DASOR_Node node2)
           
 void setWeight(int node1, int node2, int weight)
          Set a weight between two nodes
 java.lang.String toString()
          Return a string which contains the matrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DASOR_AdjMatrix

public DASOR_AdjMatrix(int size)
Default constructor

Parameters:
size - is the size of the matrix
Method Detail

getSize

public int getSize()
Return the size

Returns:
size of the matrix

getWeight

public int getWeight(int node1,
                     int node2)
Return the weight between node 1 and node 2. Return 0 if there's no link between the nodes

Parameters:
node1 - the first node
node2 - the second node

getLink

public DASOR_Link getLink(int node1,
                          int node2)

getLinkClicked

public DASOR_Link getLinkClicked(double x,
                                 double y)

setWeight

public void setWeight(int node1,
                      int node2,
                      int weight)
Set a weight between two nodes

Parameters:
node1 - first node
node2 - second node
weight - the weight

setPos

public void setPos(DASOR_Node node1,
                   DASOR_Node node2)

addNode

public void addNode()

isLink

public boolean isLink(int node1,
                      int node2)
Return true if a link exists between the node1 and the node2, false otherwise.

Parameters:
node1 - first node
node2 - second node

delNode

public void delNode(int node)
Delete the node.

Parameters:
node - : the node to be deleted.

empty

public void empty()
Empty the matrix


toString

public java.lang.String toString()
Return a string which contains the matrix

Overrides:
toString in class java.lang.Object
Returns:
string