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
-
Attribute(String, AttrBundle)
- Construct an Attribute of type AttrBundle
-
Attribute(String, boolean)
- Construct an Attribute of type boolean.
-
Attribute(String, double)
- Construct an Attribute of type double.
-
Attribute(String, long)
- Construct an Attribute of type long.
-
Attribute(String, Object)
- Construct an attribute from a name and a value object
-
Attribute(String, String)
- Construct an Attribute of type String.
-
Attribute(String, String, String)
- Construct an Attribute from String representations of type and
value.
-
booleanValue()
- Get the value of this Attribute as a boolean.
-
bundleValue()
- Get the value of this Attribute as an AttrBundle.
-
doubleValue()
- Get the value of this Attribute as a double.
-
equals(Attribute)
- Compare two Attributes to see if they are equal.
-
getKey()
- Get the key of this Attribute.
-
getTypeString()
- Get a string representation of the type of this Attribute.
-
getValue()
- Get the value of this Attribute.
-
getValueString()
- Return a string representation of the value of this Attribute.
-
longValue()
- Get the value of this Attribute as a long.
-
stringValue()
- Get the value of this Attribute as a String.
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.
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.
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.
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.
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.
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.
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.
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.
getKey
public String getKey()
- Get the key of this Attribute.
- Returns:
- key of this Attribute.
getValue
public Object getValue()
- Get the value of this Attribute.
- Returns:
- value of this Attribute.
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.
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.
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.
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.
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.
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.
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