com.mizar.graphtheory
Class Edge

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

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

See Also:
Serialized Form

Constructor Summary
Edge(Graph graph)
           
Edge(Graph graph, java.lang.Object reference)
           
Edge(Graph graph, java.lang.Object reference, Polyline polyline)
           
Edge(Graph graph, Polyline polyline)
           
Edge(Polyline geom, Node toNode, Node fromNode)
           
 
Method Summary
 void clearWalk()
           
 int compareTo(java.lang.Object o)
          Compares two Edge objects using id
 boolean equals(java.lang.Object o)
           
 Node getFromNode()
           
 Graph getGraph()
           
 long getId()
           
 Node getLeaf()
          Returns the leaf node of an edge if one exists.
 Face getLeftFace()
           
 Node getOtherNode(Node thisNode)
           
 Polyline getPolyline()
           
 java.lang.Object getReference()
           
 Face getRightFace()
           
 int getSubNetworkId()
           
 Node getToNode()
           
 int getUserId()
           
 double getWeight()
          Returns the area of the edge
 int hashCode()
           
 boolean isConnected(Edge edge)
           
 boolean isFromNode(Node testNode)
           
 boolean isGeomReversed()
           
 boolean isImmovable()
           
 boolean isReversed()
           
 boolean isToNode(Node testNode)
           
 boolean isVisited()
           
 void reverse(boolean reverseGeom)
           
 void setFromNode(Node fromNode)
           
 void setGeomReversed(boolean geomReversed)
           
 void setGraph(Graph graph)
           
 void setId(long id)
           
 void setImmovable(boolean immovable)
           
 void setLeftFace(Face leftFace)
           
 void setPolyline(Polyline geom)
           
 void setReference(java.lang.Object reference)
           
 void setReversed(boolean reversed)
           
 void setRightFace(Face rightFace)
           
 void setSubNetworkId(int subNetworkId)
           
 void setToNode(Node toNode)
           
 void setUserId(int userId)
           
 void setVisited(boolean visited)
           
 void setWeight(java.lang.Double weight)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Edge

public Edge(Graph graph)

Edge

public Edge(Graph graph,
            java.lang.Object reference)

Edge

public Edge(Graph graph,
            Polyline polyline)

Edge

public Edge(Graph graph,
            java.lang.Object reference,
            Polyline polyline)

Edge

public Edge(Polyline geom,
            Node toNode,
            Node fromNode)
Method Detail

setReference

public void setReference(java.lang.Object reference)

getReference

public java.lang.Object getReference()

isConnected

public boolean isConnected(Edge edge)

reverse

public void reverse(boolean reverseGeom)

clearWalk

public void clearWalk()

getWeight

public double getWeight()
                 throws ConnectivityException
Returns the area of the edge

Returns:
the area of the edge.
Throws:
ConnectivityException

setWeight

public void setWeight(java.lang.Double weight)

getLeaf

public Node getLeaf()
Returns the leaf node of an edge if one exists.

Returns:
a leaf node or null if there aren't any.

getOtherNode

public Node getOtherNode(Node thisNode)

isToNode

public boolean isToNode(Node testNode)

isFromNode

public boolean isFromNode(Node testNode)

setPolyline

public void setPolyline(Polyline geom)

getPolyline

public Polyline getPolyline()

setToNode

public void setToNode(Node toNode)

getToNode

public Node getToNode()

setFromNode

public void setFromNode(Node fromNode)

getFromNode

public Node getFromNode()

setVisited

public void setVisited(boolean visited)

isVisited

public boolean isVisited()

setSubNetworkId

public void setSubNetworkId(int subNetworkId)

getSubNetworkId

public int getSubNetworkId()

setUserId

public void setUserId(int userId)

getUserId

public int getUserId()

setGeomReversed

public void setGeomReversed(boolean geomReversed)

isGeomReversed

public boolean isGeomReversed()

setReversed

public void setReversed(boolean reversed)

isReversed

public boolean isReversed()

setLeftFace

public void setLeftFace(Face leftFace)

getLeftFace

public Face getLeftFace()

setRightFace

public void setRightFace(Face rightFace)

getRightFace

public Face getRightFace()
Returns:

setId

public void setId(long id)

getId

public long getId()

setGraph

public void setGraph(Graph graph)

getGraph

public Graph getGraph()

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 o)
Compares two Edge objects using id

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o. - The other Edge to compare.
Returns:
0 if both Edge are the same. 1 if this Edge's ID is larger. -1 if this Edge's ID is smaller.

setImmovable

public void setImmovable(boolean immovable)

isImmovable

public boolean isImmovable()