org.gicentre.utils.network

## Class Node

- java.lang.Object
- - 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.4, 5th February, 2016.
  Author:
    Jo Wood, giCentre, City University London.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Node(float x, float y)` Creates a node with the given location.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 set 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 set 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. Note the order of edges is not guaranteed and may differ from the outgoing edge set even if undirected.
      Returns:
        Set of all incoming edges attached to the node.

    - #### 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. Note the order of edges is not guaranteed and may differ from the outgoing edge set even if undirected.
      Returns:
        Set of all outgoing edges attached to the node.