org.cfpm.caves.za
Class NetworkLink

java.lang.Object
  extended by uchicago.src.sim.network.DefaultEdge
      extended by uchicago.src.sim.network.DefaultDrawableEdge
          extended by org.cfpm.caves.za.NetworkLink
All Implemented Interfaces:
uchicago.src.sim.gui.DrawableEdge, uchicago.src.sim.network.Edge

public class NetworkLink
extends uchicago.src.sim.network.DefaultDrawableEdge

Simple directed link between network nodes. Instead of subclasses for different types, the type attribute inherited from DefaultEdge is used to express different link types --> different network layers.

Author:
Ruth Meyer

Field Summary
private  java.beans.PropertyChangeSupport pcs
           
 
Fields inherited from class uchicago.src.sim.network.DefaultEdge
from, label, strength, to, type
 
Constructor Summary
NetworkLink()
          Parameterless constructor.
NetworkLink(NetworkNode from, NetworkNode to)
          Creates a network link between the two given nodes.
NetworkLink(NetworkNode from, NetworkNode to, java.lang.String type)
          Creates a network link of the given type between the two given nodes.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener p)
          adds a property change listener (for Jess)
 NetworkNode getFrom()
          returns the from node.
 jess.Value getFromID()
          returns the node id of the from node.
 NetworkNode getTo()
          returns the to node.
 jess.Value getToID()
          returns the node id of the to node.
 void removePropertyChangeListener(java.beans.PropertyChangeListener p)
          removes a property change listener (for Jess)
 void setFrom(NetworkNode from)
          sets the from node to the given node.
 void setTo(NetworkNode to)
          sets the to node to the given node.
 void setType(java.lang.String type)
          sets the link type
 java.lang.String toString()
          returns a String representation of this link
 
Methods inherited from class uchicago.src.sim.network.DefaultDrawableEdge
draw, setColor, setDrawDirected
 
Methods inherited from class uchicago.src.sim.network.DefaultEdge
getLabel, getStrength, getType, setFrom, setLabel, setStrength, setTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uchicago.src.sim.network.Edge
getLabel, getStrength, getType, setFrom, setLabel, setStrength, setTo
 

Field Detail

pcs

private java.beans.PropertyChangeSupport pcs
Constructor Detail

NetworkLink

public NetworkLink()
Parameterless constructor. Creates a new "empty" network link.


NetworkLink

public NetworkLink(NetworkNode from,
                   NetworkNode to)
Creates a network link between the two given nodes.

Parameters:
from - the from node
to - the to node

NetworkLink

public NetworkLink(NetworkNode from,
                   NetworkNode to,
                   java.lang.String type)
Creates a network link of the given type between the two given nodes.

Parameters:
from - the from node
to - the to node
type - the link type
Method Detail

getFrom

public NetworkNode getFrom()
returns the from node.

Specified by:
getFrom in interface uchicago.src.sim.network.Edge
Overrides:
getFrom in class uchicago.src.sim.network.DefaultEdge
Returns:
the from node

setFrom

public void setFrom(NetworkNode from)
sets the from node to the given node.

Parameters:
from - the from node

getTo

public NetworkNode getTo()
returns the to node.

Specified by:
getTo in interface uchicago.src.sim.network.Edge
Overrides:
getTo in class uchicago.src.sim.network.DefaultEdge
Returns:
the to node

setTo

public void setTo(NetworkNode to)
sets the to node to the given node.

Parameters:
to - the from node

setType

public void setType(java.lang.String type)
sets the link type

Specified by:
setType in interface uchicago.src.sim.network.Edge
Overrides:
setType in class uchicago.src.sim.network.DefaultEdge
Parameters:
type - the link type

getFromID

public jess.Value getFromID()
returns the node id of the from node. For easier access in Jess.

Returns:
id of the from node

getToID

public jess.Value getToID()
returns the node id of the to node. For easier access in Jess.

Returns:
id of the to node

toString

public java.lang.String toString()
returns a String representation of this link

Overrides:
toString in class java.lang.Object
Returns:
String representation

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener p)
adds a property change listener (for Jess)


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener p)
removes a property change listener (for Jess)