uchicago.src.sim.network
Class DefaultEdge

java.lang.Object
  extended by uchicago.src.sim.network.DefaultEdge
All Implemented Interfaces:
Edge
Direct Known Subclasses:
DefaultDrawableEdge, HyperCycleLink, HyperLink, JainEdge, JiggleEdge, JinGirNewEdge

public class DefaultEdge
extends java.lang.Object
implements Edge

An edge between two nodes. A default implementation of Edge.

Version:
$Revision: 1.9 $ $Date: 2004/11/03 19:51:01 $
Author:
Nick Collier
See Also:
Node

Field Summary
protected  Node from
           
protected  java.lang.String label
           
protected  double strength
           
protected  Node to
           
protected  java.lang.String type
           
 
Constructor Summary
DefaultEdge()
          Constructs a DefaultEdge without any connecting Nodes.
DefaultEdge(Node from, Node to)
          Construct an edge from the specified to node to the specified node with a blank label.
DefaultEdge(Node from, Node to, java.lang.String label)
          Construct an edge from the specified to node to the specified node with the specified label, and a default strength of 1.0.
DefaultEdge(Node from, Node to, java.lang.String label, float strength)
          Construct an edge from the specified to node to the specified node with the specified label, and the specified strength.
 
Method Summary
 Node getFrom()
          Gets the from node
 java.lang.String getLabel()
          Gets the label for this Edge
 double getStrength()
          Gets the strength of this edge
 Node getTo()
          Gets the to node
 java.lang.String getType()
          Gets the type of this DefaultEdge.
 void setFrom(Node node)
          Sets the from node.
 void setLabel(java.lang.String label)
          Sets the label for this Edge
 void setStrength(double val)
          Sets the strength of this edge
 void setTo(Node node)
          Sets the to node.
 void setType(java.lang.String type)
          Sets the type of this DefaultEdge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

from

protected Node from

to

protected Node to

label

protected java.lang.String label

type

protected java.lang.String type

strength

protected double strength
Constructor Detail

DefaultEdge

public DefaultEdge()
Constructs a DefaultEdge without any connecting Nodes. This is primarily used to load this class in a "bean-like" fashion.


DefaultEdge

public DefaultEdge(Node from,
                   Node to,
                   java.lang.String label)
Construct an edge from the specified to node to the specified node with the specified label, and a default strength of 1.0. This edge is not automatically added to the nodes, and so each node must add the edge.

Parameters:
from - the from Node
to - the to Node
label - for this edge

DefaultEdge

public DefaultEdge(Node from,
                   Node to,
                   java.lang.String label,
                   float strength)
Construct an edge from the specified to node to the specified node with the specified label, and the specified strength. This edge is not automatically added to the nodes, and so each node must add the edge.

Parameters:
from - the from Node
to - the to Node
label - the label for this edge
strength - the strength of this edge

DefaultEdge

public DefaultEdge(Node from,
                   Node to)
Construct an edge from the specified to node to the specified node with a blank label. This edge is not automatically added to the nodes, and so each node must add the edge.

Parameters:
from - the from Node
to - the to Node
Method Detail

getFrom

public Node getFrom()
Gets the from node

Specified by:
getFrom in interface Edge

setFrom

public void setFrom(Node node)
Sets the from node. This will automatically make the appropriate changes in the corresponding to node and also add this edge as an out edge to the specified Node.

Specified by:
setFrom in interface Edge

getTo

public Node getTo()
Gets the to node

Specified by:
getTo in interface Edge

setTo

public void setTo(Node node)
Sets the to node. This will automatically make the appropriate changes in the corresponding from node and also add this edge as an in edge to the specified Node.

Specified by:
setTo in interface Edge

setLabel

public void setLabel(java.lang.String label)
Sets the label for this Edge

Specified by:
setLabel in interface Edge
Parameters:
label - the label for this edge

getLabel

public java.lang.String getLabel()
Gets the label for this Edge

Specified by:
getLabel in interface Edge

setStrength

public void setStrength(double val)
Sets the strength of this edge

Specified by:
setStrength in interface Edge

getStrength

public double getStrength()
Gets the strength of this edge

Specified by:
getStrength in interface Edge

getType

public java.lang.String getType()
Gets the type of this DefaultEdge. The type is intended to contain the type of network this edge represents (i.e. kinship, business etc.).

Specified by:
getType in interface Edge

setType

public void setType(java.lang.String type)
Sets the type of this DefaultEdge. The type is intended to contain the type of network this edge represents (i.e. kinship, business etc.).

Specified by:
setType in interface Edge
Parameters:
type - this DefaultEdge's type (i.e. the network type)