netkit.graph
Class EdgeType

java.lang.Object
  extended by netkit.graph.EdgeType

public final class EdgeType
extends java.lang.Object

This class represents an edge type for the Edge class. EdgeTypes specify the acceptable types for the source and destination Nodes of an Edge. This class is immutable.

Author:
Kaveh R. Ghazi
See Also:
Graph, Node, Edge, Attributes, SchemaReader

Constructor Summary
EdgeType(java.lang.String name, java.lang.String sourceType, java.lang.String destType)
          The constructor requires a name, source type and destination type.
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one; note this method assumes that each instance has a unique name and uses the name for equality purposes.
 java.lang.String getDestType()
          Get the destination type of this object.
 java.lang.String getName()
          Get the name of this object.
 java.lang.String getSourceType()
          Get the source type of this object.
 int hashCode()
          Returns a hash code value for this object.
 java.lang.String toString()
          Returns a String representation for this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EdgeType

public EdgeType(java.lang.String name,
                java.lang.String sourceType,
                java.lang.String destType)
The constructor requires a name, source type and destination type.

Parameters:
name - a string name uniquely identifying this edge type.
sourceType - a string representing the type of the source node.
destType - a string representing the type of the destination node.
Method Detail

getName

public java.lang.String getName()
Get the name of this object.

Returns:
the name of this object.

getSourceType

public java.lang.String getSourceType()
Get the source type of this object.

Returns:
the source type of this object.

getDestType

public java.lang.String getDestType()
Get the destination type of this object.

Returns:
the destination type of this object.

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one; note this method assumes that each instance has a unique name and uses the name for equality purposes. The constraint on name uniqueness is enforced by the Graph class which holds EdgeTypes.

Overrides:
equals in class java.lang.Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the argument; false otherwise.
See Also:
Graph.addEdgeType(EdgeType)

toString

public java.lang.String toString()
Returns a String representation for this object.

Overrides:
toString in class java.lang.Object
Returns:
a String representation for this object.