|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuchicago.src.sim.network.DefaultNode
uchicago.src.sim.network.DefaultDrawableNode
org.cfpm.caves.za.NetworkNode
public class NetworkNode
A node in a (social) network; refers to a person or household. Was originally planned to be used as shadow fact in Jess, together with the link class, so that all networks would be represented as nodes and links to be simultaneously "visible" in Jess and Java and displayable in Repast. Alas, it turned out that this wasn't the most efficient way to represent networks so it was more or less completely dropped. Persons and households still have nodes and the kinship network and friend network are maintained as links if the GUI is switched on.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class uchicago.src.sim.network.DefaultNode |
---|
uchicago.src.sim.network.DefaultNode.OrderedHashMap |
Field Summary | |
---|---|
(package private) jess.Value |
id
the node id |
private java.beans.PropertyChangeSupport |
pcs
|
Fields inherited from class uchicago.src.sim.network.DefaultDrawableNode |
---|
item |
Fields inherited from class uchicago.src.sim.network.DefaultNode |
---|
inEdges, inMap, label, outEdges, outMap |
Constructor Summary | |
---|---|
NetworkNode()
Parameterless constructor. |
|
NetworkNode(jess.Value id)
Creates a new network node with the given id. |
Method Summary | |
---|---|
private java.lang.String |
abbreviate(jess.Value id)
internal helper function: abbreviates the node id to be used as the node label |
void |
addInEdge(NetworkLink link)
adds the given link as an incoming edge |
void |
addOutEdge(NetworkLink link)
adds the given link as an outgoing edge |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener p)
adds a property change listener (for Jess) |
boolean |
equals(java.lang.Object o)
Compare the given object to this node. |
jess.Value |
getId()
returns the node id |
private void |
init()
internal function: creates the graphical representation of the node |
void |
removeFromLinks(java.lang.String type)
removes the outgoing links of the specified type |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener p)
removes a property change listener (for Jess) |
void |
setId(java.lang.String newId)
sets the node id |
void |
setId(jess.Value newId)
sets the node id |
java.lang.String |
toString()
returns a String representation of this node |
Methods inherited from class uchicago.src.sim.network.DefaultDrawableNode |
---|
allowResizing, calcSize, contains, draw, getBorderColor, getBorderWidth, getColor, getFont, getHeight, getLabelColor, getNode, getWidth, getX, getY, setBorderColor, setBorderWidth, setColor, setDrawable, setDrawableNoCopy, setFont, setHeight, setLabelColor, setNodeLabel, setWidth, setX, setX, setY, setY |
Methods inherited from class uchicago.src.sim.network.DefaultNode |
---|
addInEdge, addInEdges, addOutEdge, addOutEdges, clearInEdges, clearOutEdges, getEdgesFrom, getEdgesTo, getFromNodes, getInDegree, getInEdges, getInNodes, getNodeLabel, getNumInEdges, getNumOutEdges, getOutDegree, getOutEdges, getOutNodes, getRandomFromNode, getRandomNodeIn, getRandomNodeOut, getRandomToNode, getToNodes, hasEdgeFrom, hasEdgeTo, hasEdgeToOrFrom, makeRandomInEdge, makeRandomOutEdge, removeEdgesFrom, removeEdgesTo, removeInEdge, removeOutEdge |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface uchicago.src.sim.gui.DrawableNonGridNode |
---|
getOutEdges |
Methods inherited from interface uchicago.src.sim.gui.Drawable2DGridNode |
---|
getOutEdges |
Field Detail |
---|
jess.Value id
private java.beans.PropertyChangeSupport pcs
Constructor Detail |
---|
public NetworkNode()
public NetworkNode(jess.Value id)
id
- the node idMethod Detail |
---|
private void init()
public void setId(jess.Value newId)
newId
- the node's new idpublic void setId(java.lang.String newId)
newId
- the node's new id as a Stringprivate java.lang.String abbreviate(jess.Value id)
public jess.Value getId()
getId
in interface uchicago.src.sim.network.Node
getId
in class uchicago.src.sim.network.DefaultNode
public void addInEdge(NetworkLink link)
link
- the network linkpublic void addOutEdge(NetworkLink link)
link
- the network linkpublic void addPropertyChangeListener(java.beans.PropertyChangeListener p)
public void removePropertyChangeListener(java.beans.PropertyChangeListener p)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare with
public void removeFromLinks(java.lang.String type)
type
- the link type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |