oracle.dmt.odm.data
Class AttributeInstance

java.lang.Object
  |
  +--oracle.dmt.odm.MiningObject
        |
        +--oracle.dmt.odm.data.Attribute
              |
              +--oracle.dmt.odm.data.AttributeInstance
All Implemented Interfaces:
java.io.Serializable

public class AttributeInstance
extends Attribute

An instance of AttributeInstance supports providing named and typed values as input for various functions. This class is currently used in conjunction with RecordInstance. AttributeInstance supports the three data types String, int, and float.

Since:
9.0.1
See Also:
Serialized Form

Constructor Summary
AttributeInstance(java.lang.String attributeName, float value)
          Constructs a float instance with the specified name and value.
AttributeInstance(java.lang.String attributeName, int value)
          Constructs an integer instance with the specified name and value.
AttributeInstance(java.lang.String attributeName, java.lang.String value)
          Constructs a string instance with the specified name and value.
 
Method Summary
TypeMethod
 float getFloatValue()
          If data type is float, return the stored float value.
 int getIntValue()
          If data type is int, return the stored integer value.
 java.lang.String getStringValue()
          If data type is String, return the stored String value; otherwise return null.
 
Methods inherited from class oracle.dmt.odm.data.Attribute
equals, getDataType, getName, setDataType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeInstance

public AttributeInstance(java.lang.String attributeName,
                         int value)
                  throws InvalidArgumentException,
                         ODMException
Constructs an integer instance with the specified name and value.
Parameters:
attributeName - attribute name
value - int type attribute value
Throws:
InvalidArgumentException - is thrown
- when the attributeName/type are null
- when the attributeName > 30 bytes

AttributeInstance

public AttributeInstance(java.lang.String attributeName,
                         float value)
                  throws InvalidArgumentException,
                         ODMException
Constructs a float instance with the specified name and value.
Parameters:
attributeName - attribute name
value - float type attribute value
Throws:
InvalidArgumentException - is thrown
- when the attributeName/type are null
- when the attributeName > 30 bytes

AttributeInstance

public AttributeInstance(java.lang.String attributeName,
                         java.lang.String value)
                  throws InvalidArgumentException,
                         ODMException
Constructs a string instance with the specified name and value.
Parameters:
attributeName - attribute name
value - string type attribute value
Throws:
InvalidArgumentException - is thrown
- when the attributeName/type are null
- when the attributeName > 30 bytes
Method Detail

getIntValue

public int getIntValue()
If data type is int, return the stored integer value.
Returns:
int attribute value
Throws:
NumberFormatException - is thrown
- if the string does not contain a parsable integer

getFloatValue

public float getFloatValue()
If data type is float, return the stored float value.
Returns:
float attribute value
Throws:
NumberFormatException - is thrown
- if the string does not contain a parsable float

getStringValue

public java.lang.String getStringValue()
If data type is String, return the stored String value; otherwise return null.
Returns:
String attribute value