org.deri.iris.graph
Class LabeledEdge<V,L>

java.lang.Object
  extended by DefaultEdge
      extended by org.deri.iris.graph.LabeledEdge<V,L>

public class LabeledEdge<V,L>
extends DefaultEdge

This class represents a simple implementation of a labeled edge.

This class was only made, because the Graph class prohibits adding of two equal edges.

NOTE: do not use this class outside of this project! We don't know whether to keep this class in the api!

$Id: LabeledEdge.java,v 1.2 2007-10-09 20:23:12 bazbishop237 Exp $

Version:
$Revision: 1.2 $
Author:
Richard P??ttler (richard dot poettler at deri dot org)

Constructor Summary
LabeledEdge(V source, V target)
          A constructor which sets the source, taget and the label.
LabeledEdge(V source, V target, L label)
          A constructor which sets the source, taget and the label.
 
Method Summary
 boolean equals(Object o)
           
 L getLabel()
          Returns the actual label of the edge.
 V getSource()
           
 V getTarget()
           
 int hashCode()
           
 boolean hasLabel()
          Returns whether there is actually a label set.
 String toString()
           Returns a simple string representation of this labeled directed edge.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabeledEdge

public LabeledEdge(V source,
                   V target)
A constructor which sets the source, taget and the label.

Parameters:
source - the source vertex
target - the target vertex
Throws:
NullPointerException - if the source or the tages are null

LabeledEdge

public LabeledEdge(V source,
                   V target,
                   L label)
A constructor which sets the source, taget and the label.

Parameters:
source - the source vertex
target - the target vertex
label - the label to set
Throws:
NullPointerException - if the source or the tages are null
Method Detail

getSource

public V getSource()

getTarget

public V getTarget()

getLabel

public L getLabel()
Returns the actual label of the edge.

Returns:
the label

hasLabel

public boolean hasLabel()
Returns whether there is actually a label set.

Returns:
true if the label is not null, otherwise false

equals

public boolean equals(Object o)

hashCode

public int hashCode()

toString

public String toString()

Returns a simple string representation of this labeled directed edge. The subject of the stringrepresentation is to change.

An example String could be: source->(label)->target.

Returns:
the string representation