nanomunchers.graph
Class Node

java.lang.Object
  extended bynanomunchers.graph.Node

public class Node
extends java.lang.Object

A single node in a graph.

Author:
David Kaplin

Constructor Summary
Node(Graph owner, int id, int x, int y)
           
 
Method Summary
 void clear()
          Removes marking
 Graph getGraph()
           
 int getId()
           
 Node[] getNeighbors()
           
 java.awt.Point getPoint()
           
 int getX()
           
 int getY()
           
 boolean isMarked()
           
 void mark()
          Marks the node
 java.lang.String toString()
          Descriptive string about the node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node(Graph owner,
            int id,
            int x,
            int y)
Parameters:
owner - for the node to know other nodes and edges
id - internal id
x - virtual position
y - virtual position
Method Detail

getId

public int getId()
Returns:
internal id

getX

public int getX()
Returns:
virtual screen position

getPoint

public java.awt.Point getPoint()
Returns:
point representation of virtual screen position

getY

public int getY()
Returns:
virtual screen position

mark

public void mark()
Marks the node


isMarked

public boolean isMarked()
Returns:
true if marked.

clear

public void clear()
Removes marking


toString

public java.lang.String toString()
Descriptive string about the node

See Also:
Object.toString()

getNeighbors

public Node[] getNeighbors()
Returns:
all neighbors of this node

getGraph

public Graph getGraph()
Returns:
that owns this node.