com.sas.portal.portlet.configuration
Interface Attribute

All Superinterfaces:
java.io.Serializable

public interface Attribute
extends java.io.Serializable

Attributes map name/value pairs into metadata records. Currently, only OMR TypedProperty's are supported. Like Configuration, an Attribute cannot be directly instantiated. Clients should call Configuration.setAttribute(). Attribute provides a number of convenience methods to translate the metadata representation of the Attribute value.

Since:
1/15/2003
See Also:
Configuration

Method Summary
 java.lang.String getName()
          Get the name of the attribute
 java.lang.String getValue()
          Get the value of the attribute
 boolean getValueAsBoolean()
          Get the value of the attribute, as a boolean.
 boolean getValueAsBoolean(boolean defaultValue)
          Get the value of the attribute, as a boolean.
 double getValueAsDouble()
          Get the value of the attribute, as a double.
 double getValueAsDouble(double defaultValue)
          Get the value of the attribute, as a double.
 float getValueAsFloat()
          Get the value of the attribute, as a float.
 float getValueAsFloat(float defaultValue)
          Get the value of the attribute, as a float.
 int getValueAsInt()
          Get the value of the attribute, as an int.
 int getValueAsInt(int defaultValue)
          Get the value of the attribute, as an int.
 long getValueAsLong()
          Get the value of the attribute, as a long.
 long getValueAsLong(long defaultValue)
          Get the value of the attribute, as a long.
 void setValue(java.lang.String value)
          Set the value of the attribute
 

Method Detail

getName

java.lang.String getName()
Get the name of the attribute

Returns:
String the name of the attribute

setValue

void setValue(java.lang.String value)
Set the value of the attribute

Parameters:
value - the value of the attribute

getValue

java.lang.String getValue()
Get the value of the attribute

Returns:
String the value of the attribute

getValueAsInt

int getValueAsInt(int defaultValue)
Get the value of the attribute, as an int. If the value is either not set (null) or cannot be parsed into an int, then the provided default value is used and returned instead.

Parameters:
defaultValue - the value to return if the provided value is not set (null) or cannot be represented as an int
Returns:
the value as an int, or the default value

getValueAsInt

int getValueAsInt()
Get the value of the attribute, as an int. If the value is either not set (null) or cannot be parsed into an int, then -1 is used and returned instead.

Returns:
the value as an int, or the -1

getValueAsLong

long getValueAsLong(long defaultValue)
Get the value of the attribute, as a long. If the value is either not set (null) or cannot be parsed into a long, then the provided default value is used and returned instead.

Parameters:
defaultValue - the value to return if the provided value is not set (null) or cannot be represented as a long
Returns:
the value as a long, or the default value

getValueAsLong

long getValueAsLong()
Get the value of the attribute, as a long. If the value is either not set (null) or cannot be parsed into a long, then -1 is used and returned instead.

Returns:
the value as a long, or the -1

getValueAsDouble

double getValueAsDouble(double defaultValue)
Get the value of the attribute, as a double. If the value is either not set (null) or cannot be parsed into a double, then the provided default value is used and returned instead.

Parameters:
defaultValue - the value to return if the provided value is not set (null) or cannot be represented as a double
Returns:
the value as a double, or the default value

getValueAsDouble

double getValueAsDouble()
Get the value of the attribute, as a double. If the value is either not set (null) or cannot be parsed into a double, then -1 is used and returned instead.

Returns:
the value as a double, or the -1

getValueAsFloat

float getValueAsFloat(float defaultValue)
Get the value of the attribute, as a float. If the value is either not set (null) or cannot be parsed into a float, then the provided default value is used and returned instead.

Parameters:
defaultValue - the value to return if the provided value is not set (null) or cannot be represented as a float
Returns:
the value as a float, or the default value

getValueAsFloat

float getValueAsFloat()
Get the value of the attribute, as a float. If the value is either not set (null) or cannot be parsed into a float, then -1 is used and returned instead.

Returns:
the value as a float, or the -1

getValueAsBoolean

boolean getValueAsBoolean(boolean defaultValue)
Get the value of the attribute, as a boolean. If the value is either not set (null) or cannot be parsed into a boolean, then the provided default value is used and returned instead.

Parameters:
defaultValue - the value to return if the provided value is not set (null) or cannot be represented as a boolean
Returns:
the value as a boolean, or the default value

getValueAsBoolean

boolean getValueAsBoolean()
Get the value of the attribute, as a boolean. If the value is either not set (null) or cannot be parsed into a boolean, then -1 is used and returned instead.

Returns:
the value as a boolean, or the -1



Copyright © 2009 SAS Institute Inc. All Rights Reserved.