com.metamatrix.common.tree
Interface TreeNode

All Superinterfaces:
java.lang.Comparable, PropertiedObject
All Known Subinterfaces:
DirectoryEntry, PermissionDataNode, PermissionNode
All Known Implementing Classes:
BasicTreeNode, FileSystemEntry, PermissionDataNodeImpl

public interface TreeNode
extends java.lang.Comparable, PropertiedObject

This interface represents a single entry on a hierarchical system.


Method Summary
 int compareTo(java.lang.Object par1)
          Compares this object to another.
 boolean equals(java.lang.Object par1)
          Returns true if the specified object is semantically equal to this instance.
 boolean exists()
          Return whether this TreeNode represents an existing resource.
 java.lang.String getFullName()
          Obtain the full name of the TreeNode which is unique within the TreeView.
 java.lang.String getName()
          Obtain the name of this TreeNode.
 java.lang.String getNamespace()
          Obtain the namespace to which this tree node belongs.
 java.lang.String getSeparator()
          Obtain the character (as a String) that is used to separate names in a path sequence for the abstract path.
 char getSeparatorChar()
          Obtain the character that is used to separate names in a path sequence for the abstract path.
 ObjectDefinition getType()
          Get this type for this tree node.
 boolean isModified()
          Return whether this node has undergone changes.
 java.lang.String toString()
          Return the string form of this TreeNode.
 

Method Detail

exists

boolean exists()
Return whether this TreeNode represents an existing resource.

Returns:
true the entry exists, or false otherwise.

getName

java.lang.String getName()
Obtain the name of this TreeNode. The name does not contain the namespace but is unique within the namespace of the TreeNode.

Returns:
the name of the node; never null or zero-length

getFullName

java.lang.String getFullName()
Obtain the full name of the TreeNode which is unique within the TreeView. The full name is the concatenation of the namespace, separator, and name of this TreeNode.

Returns:
the fully qualified name of this node; never null

getNamespace

java.lang.String getNamespace()
Obtain the namespace to which this tree node belongs. The separator character is used between each of the components of the namespace.

Returns:
the string that represents the namespace of this node; never null

getType

ObjectDefinition getType()
Get this type for this tree node.

Returns:
the entity's type; never null

getSeparatorChar

char getSeparatorChar()
Obtain the character that is used to separate names in a path sequence for the abstract path. This character is completely dependent upon the implementation.

Returns:
the charater used to delimit names in the abstract path.

getSeparator

java.lang.String getSeparator()
Obtain the character (as a String) that is used to separate names in a path sequence for the abstract path.

Returns:
the string containing the charater used to delimit names in the abstract path; never null

isModified

boolean isModified()
Return whether this node has undergone changes. The time from which changes are maintained is left to the implementation.

Returns:
true if this TreeNode has changes, or false otherwise.

compareTo

int compareTo(java.lang.Object par1)
Compares this object to another. If the specified object is an instance of the TreeNode class, then this method compares the contents; otherwise, it throws a ClassCastException (as instances are comparable only to instances of the same class).

Note: this method is consistent with equals(), meaning that (compare(x, y)==0) == (x.equals(y)).

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the object that this instance is to be compared to.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object, respectively.
Throws:
java.lang.IllegalArgumentException - if the specified object reference is null
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this instance.

equals

boolean equals(java.lang.Object par1)
Returns true if the specified object is semantically equal to this instance. Note: this method is consistent with compareTo().

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object that this instance is to be compared to.
Returns:
whether the object is equal to this object.

toString

java.lang.String toString()
Return the string form of this TreeNode.

Overrides:
toString in class java.lang.Object
Returns:
the stringified abstract path, equivalent to getPath


Copyright © 2009. All Rights Reserved.