org.bibalex.daf.commongui.datamodels
Class TreeDataModel.TreeObject

java.lang.Object
  extended by org.bibalex.daf.commongui.datamodels.TreeDataModel.TreeObject
Enclosing class:
TreeDataModel

public class TreeDataModel.TreeObject
extends java.lang.Object

Represents an A tree Node object, maintains the node Type, DB ID representing this node, and value to be displayed.

Author:
Fadi.Edward

Field Summary
 int id
          The DB Identified of this node.
 java.lang.String parentName
          The parent Name of this node.
 TreeDataModel.TreeObjectTypes treeObjectType
          The type of the node, whether root, element or child.
 java.lang.String value
          The value to be displayed.
 
Constructor Summary
TreeDataModel.TreeObject(int id, java.lang.String value, TreeDataModel.TreeObjectTypes treeObjectType)
          Constructor
TreeDataModel.TreeObject(int id, java.lang.String value, TreeDataModel.TreeObjectTypes treeObjectType, java.lang.String parentName)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares 2 TreeObjects based on the DB ID in case they are of the same type.
 java.lang.String toString()
          Implementing a toString method to override the one in Object, to be able to display the values on the tree properly.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public int id
The DB Identified of this node.


value

public java.lang.String value
The value to be displayed.


parentName

public java.lang.String parentName
The parent Name of this node.


treeObjectType

public TreeDataModel.TreeObjectTypes treeObjectType
The type of the node, whether root, element or child.

Constructor Detail

TreeDataModel.TreeObject

public TreeDataModel.TreeObject(int id,
                                java.lang.String value,
                                TreeDataModel.TreeObjectTypes treeObjectType)
Constructor

Parameters:
id - The DB Identified of this node.
value - The value to be displayed.
treeObjectType - The type of the node, whether root, element or child.

TreeDataModel.TreeObject

public TreeDataModel.TreeObject(int id,
                                java.lang.String value,
                                TreeDataModel.TreeObjectTypes treeObjectType,
                                java.lang.String parentName)
Constructor

Parameters:
id - The DB Identified of this node.
value - The value to be displayed.
treeObjectType - The type of the node, whether root, element or child.
parentName - The parent name of this Child.
Method Detail

toString

public java.lang.String toString()
Implementing a toString method to override the one in Object, to be able to display the values on the tree properly.

Overrides:
toString in class java.lang.Object
Returns:
the string value to be displayed.

equals

public boolean equals(java.lang.Object obj)
Compares 2 TreeObjects based on the DB ID in case they are of the same type.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare to.
Returns:
true if equal, false otherwise.