All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sgi.sysadm.util.Attribute

java.lang.Object
   |
   +----com.sgi.sysadm.util.Attribute

public class Attribute
extends Object
Attribute is a typed key/value pair. The set of types which the value of an Attribute can take on is closed; an Attribute is of type String, long, boolean, double, or AttrBundle.

Attributes can be aggregated into AttrBundles.

See Also:
AttrBundle

Constructor Index

 o Attribute(String, AttrBundle)
Construct an Attribute of type AttrBundle
 o Attribute(String, boolean)
Construct an Attribute of type boolean.
 o Attribute(String, double)
Construct an Attribute of type double.
 o Attribute(String, long)
Construct an Attribute of type long.
 o Attribute(String, Object)
Construct an attribute from a name and a value object
 o Attribute(String, String)
Construct an Attribute of type String.
 o Attribute(String, String, String)
Construct an Attribute from String representations of type and value.

Method Index

 o booleanValue()
Get the value of this Attribute as a boolean.
 o bundleValue()
Get the value of this Attribute as an AttrBundle.
 o doubleValue()
Get the value of this Attribute as a double.
 o equals(Attribute)
Compare two Attributes to see if they are equal.
 o getKey()
Get the key of this Attribute.
 o getTypeString()
Get a string representation of the type of this Attribute.
 o getValue()
Get the value of this Attribute.
 o getValueString()
Return a string representation of the value of this Attribute.
 o longValue()
Get the value of this Attribute as a long.
 o stringValue()
Get the value of this Attribute as a String.

Constructors

 o Attribute
 public Attribute(String key,
                  long value)
Construct an Attribute of type long.

Parameters:
key - Key for this Attribute.
value - long value for this Attribute.
 o Attribute
 public Attribute(String key,
                  boolean value)
Construct an Attribute of type boolean.

Parameters:
key - Key for this Attribute.
value - boolean value for this Attribute.
 o Attribute
 public Attribute(String key,
                  String value)
Construct an Attribute of type String.

Parameters:
key - Key for this Attribute.
value - String value for this Attribute.
 o Attribute
 public Attribute(String key,
                  double value)
Construct an Attribute of type double.

Parameters:
key - Key for this Attribute.
value - double value for this Attribute.
 o Attribute
 public Attribute(String key,
                  AttrBundle bundle)
Construct an Attribute of type AttrBundle

Parameters:
key - Key for this Attribute.
bundle - AttrBundle value for this Attribute.
 o Attribute
 public Attribute(String key,
                  String type,
                  String value)
Construct an Attribute from String representations of type and value. This is used by AttrBundle to construct Attributes out of a serialized stream representation.

Parameters:
key - key for this Attribute.
type - string representation of the type of this Attribute.
value - string representation of the value of this Attribute.
 o Attribute
 public Attribute(String key,
                  Object value)
Construct an attribute from a name and a value object

Parameters:
key - key for this Attribute.
type - string representation of the type of this Attribute.

Methods

 o equals
 public boolean equals(Attribute other)
Compare two Attributes to see if they are equal. Two Attributes are equal if they have the same key, type, and value.

Parameters:
other - Attribute to check for equality.
Returns:
true if Attributes are equal, false otherwise.
 o getKey
 public String getKey()
Get the key of this Attribute.

Returns:
key of this Attribute.
 o getValue
 public Object getValue()
Get the value of this Attribute.

Returns:
value of this Attribute.
 o stringValue
 public String stringValue()
Get the value of this Attribute as a String. This method will throw a ClassCastException if this Attribute is not of type String.

Returns:
String value of this Attribute.
 o longValue
 public long longValue()
Get the value of this Attribute as a long. This method will throw a ClassCastException if this Attribute is not of type long.

Returns:
long value of this Attribute.
 o booleanValue
 public boolean booleanValue()
Get the value of this Attribute as a boolean. This method will throw a ClassCastException if this Attribute is not of type boolean.

Returns:
boolean value of this Attribute.
 o doubleValue
 public double doubleValue()
Get the value of this Attribute as a double. This method will throw a ClassCastException if this Attribute is not of type double.

Returns:
double value of this Attribute.
 o bundleValue
 public AttrBundle bundleValue()
Get the value of this Attribute as an AttrBundle. This method will throw a ClassCastException if this Attribute is not of type AttrBundle.

Returns:
AttrBundle value of this Attribute.
 o getTypeString
 public String getTypeString()
Get a string representation of the type of this Attribute. This is used by AttrBundle to construct a stream representation of this Attribute.

Returns:
String representation of the type of this Attribute.
 o getValueString
 public String getValueString()
Return a string representation of the value of this Attribute. This is used by AttrBundle to construct a stream representation of this Attribute.

Returns:
String representation of the type of this Attribute.

All Packages  Class Hierarchy  This Package  Previous  Next  Index