fdda.model
Interface Node

All Superinterfaces:
PropertyHolder, WorkingPart
All Known Implementing Classes:
Node

public interface Node
extends PropertyHolder, WorkingPart

A node in a network. This is the encapsulating Object, containing both a graphical representation of the node and an algorithmic representation. A node has some properties and may be not working.

Author:
Jörg Rüdenauer
See Also:
Node, Node

Field Summary
static String ACTIVE_PROPERTY_NAME
          Name of the 'active' Property
static String LABEL_PROPERTY_NAME
          Name of the 'label' Property
static String NODE_TYPE_PROPERTY_NAME
          name of the nodeType property
 
Fields inherited from interface fdda.model.WorkingPart
WORKING_PROPERTY_NAME
 
Method Summary
 void addConnection(Connection connection)
          Adds a connection to the node.
 boolean canSendMessageDirectlyTo(Node node)
          Returns whether the node can send a message through (exactly) one connections to another node.
 Node getAlgorithmicNode()
          Returns the algorithmic representation of the node.
 List getConnections()
          Returns all the connections starting or ending at the node.
 Node getGraphicalRepresentation()
          Returns the graphical representation of the node.
 List getIncomingConnections()
          Returns all directed connections ending at the node and all undirected connections of the node.
 String getLabel()
          Returns the label of the node, which can identify the node for an user.
 List getNeighbours()
          Returns all nodes that are directly connected to this node through a connection (either directed or undirected).
 int getNr()
          Returns the internal number of the node, which is unique.
 List getOutgoingConnections()
          Returns all directed connections starting at the node and all undirected connections of the node.
 Project getProject()
          Returns the project that contains this node.
 void initialize()
          Initializes the node.
 boolean isConnectedTo(Node node)
          Returns whether there exists a connection that may transport messages directly between this node and another node.
 boolean isNeighbouredTo(Node node)
          Returns whether the node is a neighbour of the node in the parameter.
 boolean isRepeater()
          Returns whether this node is a repeater.
 void removeConnection(Connection connection)
          Removes a connection from the node.
 void setAlgorithmicNode(Node algorithmicNode)
          Specifies the algorithmic representation of the node.
 void setLabel(String label)
          Sets the label of the node.
 
Methods inherited from interface fdda.model.PropertyHolder
addProperty, addPropertyListener, changeProperty, firePropertyChanged, getProperties, getProperty, removeProperty, removePropertyListener
 
Methods inherited from interface fdda.model.WorkingPart
isWorking, setWorking
 

Field Detail

NODE_TYPE_PROPERTY_NAME

public static final String NODE_TYPE_PROPERTY_NAME
name of the nodeType property

See Also:
Constant Field Values

LABEL_PROPERTY_NAME

public static final String LABEL_PROPERTY_NAME
Name of the 'label' Property

See Also:
Constant Field Values

ACTIVE_PROPERTY_NAME

public static final String ACTIVE_PROPERTY_NAME
Name of the 'active' Property

See Also:
Constant Field Values
Method Detail

initialize

public void initialize()
Initializes the node. Calls using the created instance of the node (this) are not possible in the constructor. They must be made here. This method is called immediately after node creation.


getGraphicalRepresentation

public Node getGraphicalRepresentation()
Returns the graphical representation of the node.

Returns:
the graphical representation

getAlgorithmicNode

public Node getAlgorithmicNode()
Returns the algorithmic representation of the node.

Returns:
the algorithmic representation

setAlgorithmicNode

public void setAlgorithmicNode(Node algorithmicNode)
Specifies the algorithmic representation of the node.

Parameters:
algorithmicNode - the algorithmic representation

getNr

public int getNr()
Returns the internal number of the node, which is unique.

Returns:
the internal number

getLabel

public String getLabel()
Returns the label of the node, which can identify the node for an user.

Returns:
the label of the node

setLabel

public void setLabel(String label)
Sets the label of the node.

Parameters:
label - the new label.

getConnections

public List getConnections()
Returns all the connections starting or ending at the node.

Returns:
the connections of the node

getOutgoingConnections

public List getOutgoingConnections()
Returns all directed connections starting at the node and all undirected connections of the node.

Returns:
all connections on which a message can leave the node

getIncomingConnections

public List getIncomingConnections()
Returns all directed connections ending at the node and all undirected connections of the node.

Returns:
all connections on which a message can reach the node

getNeighbours

public List getNeighbours()
Returns all nodes that are directly connected to this node through a connection (either directed or undirected).

Returns:
all neighbours of the node

isNeighbouredTo

public boolean isNeighbouredTo(Node node)
Returns whether the node is a neighbour of the node in the parameter.

Parameters:
node - a node
Returns:
whether the two nodes are neighboured

canSendMessageDirectlyTo

public boolean canSendMessageDirectlyTo(Node node)
Returns whether the node can send a message through (exactly) one connections to another node. This is the case iff there exists an outgoing connection between this node and the node in the parameter, and the connection is working.

Parameters:
node - a node
Returns:
whether this node can send a message directly to the other node

isConnectedTo

public boolean isConnectedTo(Node node)
Returns whether there exists a connection that may transport messages directly between this node and another node. The working property is not regarded here.

Parameters:
node - a node
Returns:
true, iff a connection exists between the node that has the right direction.

addConnection

public void addConnection(Connection connection)
Adds a connection to the node. No check whether the connection already was added; in this case, it gets added a second time.

Parameters:
connection - a connection

removeConnection

public void removeConnection(Connection connection)
Removes a connection from the node. If the connection isn't attached to the node, nothing happens. If the connection is attached to the node more than once, only the first attachement is removed.

Parameters:
connection - a connection

getProject

public Project getProject()
Returns the project that contains this node.

Returns:
the project

isRepeater

public boolean isRepeater()
Returns whether this node is a repeater. A repeater is a special node (it can also be shown differently in the graphics) that is passive normally and forwards any incoming message to all other neighbours.

Returns:
true iff the node is a repeater


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.