com.mizar.graphtheory
Class Node

java.lang.Object
  extended by com.mizar.graphtheory.Node
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class Node
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

See Also:
Serialized Form

Constructor Summary
Node(double precision)
           
Node(Point location, double precision)
           
 
Method Summary
 void addEdge(Edge toAdd)
           
 void clearWalk()
           
 int compareTo(java.lang.Object toTest)
           
 double distanceBetween(Node node)
          Linear distance between the 2 nodes, as the crow flys
 boolean equals(java.lang.Object o)
           
 java.util.HashMap<Edge,java.lang.Double> getAngles()
           
 Edge getEdge(Node otherNode)
          Gets the Edge that contain both this Node and otherNode
 java.util.ArrayList<Edge> getEdges()
           
 long getId()
           
 Point getLocation()
           
 Edge getOtherEdge(Edge incomingEdge)
          TODO may need to explain how other edge is selected if more than 2 edges connected to this node.
 Node getOtherNode(Edge edge)
           
 double getPrecision()
           
 int getSubNetworkId()
           
 int getUserId()
           
 int hashCode()
           
 boolean isIntersection()
           
 boolean isLeaf()
           
 boolean isOrphan()
           
 boolean isSimple()
           
 boolean isTIntersection()
           
 boolean isVisited()
           
 void moveNode(Point p)
          Moves the Node to a new Point
 void removeEdge(Edge toRemove)
           
 void setEdges(java.util.ArrayList<Edge> edgeList)
          Sets the edsge list.
 void setId(long id)
           
 void setLocation(Point location)
           
 void setPrecision(double precision)
           
 void setSubNetworkId(int subNetrorkId)
           
 void setUserId(int userId)
           
 void setVisited(boolean visited)
           
 void walk(int subNetworkId)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(double precision)

Node

public Node(Point location,
            double precision)
Parameters:
location -
Method Detail

isOrphan

public boolean isOrphan()

isLeaf

public boolean isLeaf()

isSimple

public boolean isSimple()

isIntersection

public boolean isIntersection()

isTIntersection

public boolean isTIntersection()

moveNode

public void moveNode(Point p)
Moves the Node to a new Point

Parameters:
p. - Node's new Point

walk

public void walk(int subNetworkId)

getOtherNode

public Node getOtherNode(Edge edge)
Parameters:
edge - Edge containing current node.
Returns:
The Node on the other end of the edge. Returns null if this Node is not in Edge parameter.

getEdge

public Edge getEdge(Node otherNode)
Gets the Edge that contain both this Node and otherNode

Parameters:
otherNode -
Returns:

getOtherEdge

public Edge getOtherEdge(Edge incomingEdge)
TODO may need to explain how other edge is selected if more than 2 edges connected to this node.

Parameters:
incomingEdge -
Returns:

removeEdge

public void removeEdge(Edge toRemove)

addEdge

public void addEdge(Edge toAdd)

clearWalk

public void clearWalk()

distanceBetween

public double distanceBetween(Node node)
Linear distance between the 2 nodes, as the crow flys

Parameters:
node -
Returns:
0 if something is null

setLocation

public void setLocation(Point location)

getLocation

public Point getLocation()

setEdges

public void setEdges(java.util.ArrayList<Edge> edgeList)
Sets the edsge list. pass null to clear the arcs

Parameters:
edgeList -

getEdges

public java.util.ArrayList<Edge> getEdges()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object toTest)
Specified by:
compareTo in interface java.lang.Comparable

setVisited

public void setVisited(boolean visited)

isVisited

public boolean isVisited()

setSubNetworkId

public void setSubNetworkId(int subNetrorkId)

getSubNetworkId

public int getSubNetworkId()

setUserId

public void setUserId(int userId)

getUserId

public int getUserId()

setId

public void setId(long id)

getId

public long getId()

getAngles

public java.util.HashMap<Edge,java.lang.Double> getAngles()

setPrecision

public void setPrecision(double precision)

getPrecision

public double getPrecision()