com.brunchboy.util.swing.relativelayout
Class Attribute

java.lang.Object
  |
  +--com.brunchboy.util.swing.relativelayout.Attribute

public class Attribute
extends Object

A simple, immutable class that represents a particular attribute within a RelativeLayout. It tracks both the name of the component for which the attribute is defined, and the type of the attribute.

Version:
$Id: Attribute.java,v 1.1.1.1 2002/05/13 20:51:44 jim Exp $
Author:
James Elliott, jim@brunchboy.com

Field Summary
static String VERSION
          Provides access to the CVS version of this class.
 
Constructor Summary
Attribute(String component, AttributeType type)
          Create an attribute description.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 String getComponent()
          Return the name of the component assoicated with this attribute.
 AttributeType getType()
          Return the type of attribute being represented.
 int hashCode()
          Returns a hash code value for the object.
 String toString()
          Provide a textual representation of the attribute type for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
Provides access to the CVS version of this class.

See Also:
Constant Field Values
Constructor Detail

Attribute

public Attribute(String component,
                 AttributeType type)
Create an attribute description.

Parameters:
component - the name of the component with which this attribute is associated.
type - the type of attribute being represented.
Method Detail

getComponent

public String getComponent()
Return the name of the component assoicated with this attribute.

Returns:
component for which this attribute is defined.

getType

public AttributeType getType()
Return the type of attribute being represented.

Returns:
the attribute type.

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation:

The equals method for class Attribute checks that the two attributes refer to the same component name and are of the same type.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

toString

public String toString()
Provide a textual representation of the attribute type for debugging purposes.

Overrides:
toString in class Object
Returns:
the description of this attribute type.