edu.memphis.ccrg.lida.framework.shared
Class ExtendedId

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.shared.ExtendedId

public class ExtendedId
extends java.lang.Object

Generalized Id for Both Nodes and Links. Link's source must be a Node. Link's sink can be a Node or a Link.

Author:
Javier Snaider, Ryan J. McCall

Constructor Summary
ExtendedId(int nodeId)
          Constructs an ExtendedId for a Node
ExtendedId(int sourceNodeId, ExtendedId sinkId, int categoryId)
          Constructs an ExtendedId for a Link.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getSourceNodeId()
          Returns source Node id
 int hashCode()
           
 boolean isComplexLink()
          Returns whether this ExtendedId is for a Link between a node and a Link.
 boolean isNodeId()
          Returns whether id is for a node.
 boolean isSimpleLink()
          Returns whether this ExtendedId is for a Link between 2 nodes.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtendedId

public ExtendedId(int sourceNodeId,
                  ExtendedId sinkId,
                  int categoryId)
Constructs an ExtendedId for a Link.

Parameters:
sourceNodeId - Node's id
sinkId - Sink's id
categoryId - Link's category

ExtendedId

public ExtendedId(int nodeId)
Constructs an ExtendedId for a Node

Parameters:
nodeId - Node's id
Method Detail

getSourceNodeId

public int getSourceNodeId()
Returns source Node id

Returns:
id of the source Node

isNodeId

public boolean isNodeId()
Returns whether id is for a node.

Returns:
true if this ExtendedId is for a Node.

isSimpleLink

public boolean isSimpleLink()
Returns whether this ExtendedId is for a Link between 2 nodes.

Returns:
true if id is for a simple link. false if id is for a node or a complex link.

isComplexLink

public boolean isComplexLink()
Returns whether this ExtendedId is for a Link between a node and a Link.

Returns:
true if id is for a complex link. false if id is for a node or a simple link.

equals

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

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object