com.metamatrix.common.actions
Class AttributeDefinition

java.lang.Object
  extended by com.metamatrix.common.actions.AttributeDefinition
All Implemented Interfaces:
java.lang.Comparable

public class AttributeDefinition
extends java.lang.Object
implements java.lang.Comparable


Field Summary
 int NO_ATTRIBUTE
           
 
Constructor Summary
AttributeDefinition(int code, java.lang.String label)
           
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares this object to another.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object is semantically equal to this instance.
 int getCode()
           
 java.lang.String getLabel()
           
 int hashCode()
          Overrides Object hashCode method.
 java.lang.String toString()
          Returns a string representing the current state of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ATTRIBUTE

public int NO_ATTRIBUTE
Constructor Detail

AttributeDefinition

public AttributeDefinition(int code,
                           java.lang.String label)
Method Detail

getLabel

public java.lang.String getLabel()

getCode

public int getCode()

hashCode

public int hashCode()
Overrides Object hashCode method. Note that the hash code is computed purely from the ID, so two distinct instances that have the same identifier (i.e., full name) will have the same hash code value.

This hash code must be consistent with the equals method. defined by subclasses.

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

equals

public boolean equals(java.lang.Object obj)
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.

compareTo

public int compareTo(java.lang.Object obj)
Compares this object to another. If the specified object is an instance of the same class, then this method compares the name; otherwise, it throws a ClassCastException (as instances are comparable only to instances of the same class). Note: this method is consistent with equals().

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.ClassCastException - if the specified object's type prevents it from being compared to this instance.

toString

public java.lang.String toString()
Returns a string representing the current state of the object.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this instance.


Copyright © 2009. All Rights Reserved.