org.gicentre.utils.network
Class Node

java.lang.Object
  extended by org.gicentre.utils.network.Node

public class Node
extends java.lang.Object

Represents a node in a network graph structure. This class has a default drawing behaviour, but by inheriting it and overriding its draw() method, visual appearance of the node can be customised.

Version:
3.3, 1st August, 2011.
Author:
Jo Wood, giCentre, City University London.

Constructor Summary
Node(float x, float y)
          Creates a node with the given location.
 
Method Summary
 void draw(processing.core.PApplet applet, float px, float py)
          Draws the node in the given Processing applet.
 java.util.HashSet<Edge> getInEdges()
          Reports a list of all incoming edges attached to this node.
 processing.core.PVector getLocation()
          Reports the node's location.
 java.util.HashSet<Edge> getOutEdges()
          Reports a list of all outgoing edges attached to this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(float x,
            float y)
Creates a node with the given location.

Parameters:
x - x-coordinate of the node's location.
y - y-coordinate of the node's location.
Method Detail

draw

public void draw(processing.core.PApplet applet,
                 float px,
                 float py)
Draws the node in the given Processing applet. Note that the given position coordinates might not reflect the node's own locational coordinates if, for example, drawing is part of a force-directed animation.

Parameters:
applet - Processing sketch in which to draw this node.
px - x-coordinate of this node's graphical position.
py - y-coordinate of this node's graphical position.

getLocation

public processing.core.PVector getLocation()
Reports the node's location.

Returns:
Location of this node.

getInEdges

public java.util.HashSet<Edge> getInEdges()
Reports a list of all incoming edges attached to this node. If this node is part of an undirected graph, this will contain the same set as the outgoing edges.


getOutEdges

public java.util.HashSet<Edge> getOutEdges()
Reports a list of all outgoing edges attached to this node. If this node is part of an undirected graph, this will contain the same set as the incoming edges.



giCentre Utilities V.3.3, API documentation generated 6th April, 2013