visidia.graph
Class Edge

java.lang.Object
  extended by visidia.misc.property.PropertyTable
      extended by visidia.graph.Edge
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Edge
extends PropertyTable

The Class Edge represents a graph edge as a link between two vertices.

See Also:
Serialized Form

Method Summary
 java.lang.Object clone()
           
 Vertex getDestination()
          Gets the destination.
 java.lang.String getLabel()
          Gets the label.
 Vertex getOrigin()
          Gets the origin.
 java.lang.Double getWeight()
          Gets the weight.
 boolean isConnectedTo(Vertex v)
          Checks if this edge is connected to the given vertex.
 java.lang.Boolean isOriented()
          Checks if the edge oriented.
 void remove()
          Removes the edge, specifying to its origin and destination that they are unlinked.
 void resetProperties()
          Reset properties.
 void setLabel(java.lang.String s)
          Sets the label.
 void setOriented(boolean oriented)
          Sets the orientation status.
 java.lang.Object setProperty(VisidiaProperty property)
          Sets a property.
 void setWeight(double weight)
          Sets the weight.
 void switchOriginAndDestination()
          Switch origin and destination vertices.
 
Methods inherited from class visidia.misc.property.PropertyTable
containsElement, entrySet, getLockOwner, getPropertyKeys, getVisidiaProperty, isPersistentProperty, locked, lockProperties, removeProperty, setProperties, setVisidiaProperty, unlockProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class PropertyTable

switchOriginAndDestination

public void switchOriginAndDestination()
Switch origin and destination vertices.


isConnectedTo

public boolean isConnectedTo(Vertex v)
Checks if this edge is connected to the given vertex.

Parameters:
v - the vertex to test connection with.
Returns:
true, if this edge is connected to v

remove

public void remove()
Removes the edge, specifying to its origin and destination that they are unlinked.


getOrigin

public Vertex getOrigin()
Gets the origin.

Returns:
the origin

getDestination

public Vertex getDestination()
Gets the destination.

Returns:
the destination

resetProperties

public void resetProperties()
Description copied from class: PropertyTable
Reset properties.

Overrides:
resetProperties in class PropertyTable

setProperty

public java.lang.Object setProperty(VisidiaProperty property)
Sets a property.

Parameters:
property - the property
Returns:
the previous property value of the specified key in this hashtable, or null if it did not have one.

getLabel

public java.lang.String getLabel()
Gets the label.

Returns:
the label

setLabel

public void setLabel(java.lang.String s)
Sets the label.

Parameters:
s - the new label

getWeight

public java.lang.Double getWeight()
Gets the weight.

Returns:
the weight

setWeight

public void setWeight(double weight)
Sets the weight.

Parameters:
weight - the new weight

isOriented

public java.lang.Boolean isOriented()
Checks if the edge oriented.

Returns:
true, if it is oriented

setOriented

public void setOriented(boolean oriented)
Sets the orientation status.

Parameters:
oriented - the new orientation status