org.knime.core.node.workflow
Class NodeID

java.lang.Object
  extended by org.knime.core.node.workflow.NodeID
All Implemented Interfaces:
Comparable<NodeID>

public class NodeID
extends Object
implements Comparable<NodeID>

Holds hierarchical ID of a node. The hierarchy models nested meta nodes. All IDs will have one static instance of ROOTID as their top ID in this hierarchy.

Author:
M. Berthold/B. Wiswedel, University of Konstanz

Field Summary
(package private) static NodeID ROOTID
           
 
Constructor Summary
NodeID(int ix)
          Creates top level NodeID object.
NodeID(NodeID prefix, int ix)
          Creates now NodeID object based on a predefined prefix (usually the ID of the encapsulating project or metanode) and the node's ID itself.
 
Method Summary
 int compareTo(NodeID o)
           
 boolean equals(Object obj)
           
 String getIDWithoutRoot()
           
 int getIndex()
           
 NodeID getPrefix()
           
 int hashCode()
           
 boolean hasPrefix(NodeID prefix)
          Checks for matching prefix (this node prefix can be longer, though).
 boolean hasSamePrefix(NodeID prefix)
          Checks for exact matching prefixes.
 String toString()
          Returns on string representation of index.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ROOTID

static final NodeID ROOTID
Constructor Detail

NodeID

public NodeID(NodeID prefix,
              int ix)
Creates now NodeID object based on a predefined prefix (usually the ID of the encapsulating project or metanode) and the node's ID itself.

Parameters:
prefix - of ID
ix - itself

NodeID

public NodeID(int ix)
Creates top level NodeID object.

Parameters:
ix - itself
Method Detail

getPrefix

public NodeID getPrefix()
Returns:
prefix of this node's ID.

getIndex

public int getIndex()
Returns:
index of this node (without prefix!).

getIDWithoutRoot

public String getIDWithoutRoot()

hasSamePrefix

public boolean hasSamePrefix(NodeID prefix)
Checks for exact matching prefixes.

Parameters:
prefix - to check
Returns:
true if prefix are the same

hasPrefix

public boolean hasPrefix(NodeID prefix)
Checks for matching prefix (this node prefix can be longer, though).

Parameters:
prefix - to check
Returns:
true if prefix are the same

toString

public String toString()
Returns on string representation of index.

Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

compareTo

public int compareTo(NodeID o)
Specified by:
compareTo in interface Comparable<NodeID>
See Also:
Comparable.compareTo(java.lang.Object)


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.