oracle.dmt.odm
Class Category

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

public class Category
extends MiningObject

An instance of Category represents a value of a categorical attribute, for example, the value "blue" of attribute "color", or number "5" of the attribute "rating". A category may have a display name to be used when ODM displays the category in output results.

Since:
9.0.1
See Also:
Serialized Form

Constructor Summary
Category(boolean value)
          Creates a boolean Category instance with display name set to the string representation of the boolean, "TRUE" or "FALSE".
Category(float value)
          Creates a float Category instance with display name set to the string representation of the float.
Category(int value)
          Creates an int Category instance with display name set to the string representation of the int.
Category(java.lang.String value)
          Creates a string Category instance with display name set to the value.
Category(java.lang.String value, DataType type)
          Creates a Category instance accepting the value as a string with the data type is used for the display name.
Category(java.lang.String displayName, float value)
          Creates a float Category instance with the provided display name.
Category(java.lang.String displayName, int value)
          Creates an int Category instance with the provided display name.
Category(java.lang.String displayName, java.lang.String value)
          Creates a string Category instance with the provided display name.
Category(java.lang.String displayName, java.lang.String value, DataType dataType)
          Creates a Category instance with the provided display name value and data type.
 
Method Summary
TypeMethod
 boolean equals(Category cat)
          Returns true if both categories have the same display name and value.
 DataType getDataType()
          Returns the data type of the Category.
 java.lang.String getDisplayName()
          Returns the display name of the Category.
 java.lang.String getValue()
          Returns the value of the Category.
 java.lang.String toString()
          Returns a formatted string representation of the Category instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Category

public Category(java.lang.String value,
                DataType type)
         throws InvalidArgumentException,
                ODMException
Creates a Category instance accepting the value as a string with the data type is used for the display name.
Parameters:
value - value of the category
type - data type of the category
Throws:
InvalidArgumentException
- - value or type is null
- value length > 64 characters
Since:
9.2.0

Category

public Category(int value)
Creates an int Category instance with display name set to the string representation of the int.
Parameters:
value - value of the category
Since:
9.2.0

Category

public Category(float value)
Creates a float Category instance with display name set to the string representation of the float.
Parameters:
value - value of the category
Since:
9.2.0

Category

public Category(boolean value)
Creates a boolean Category instance with display name set to the string representation of the boolean, "TRUE" or "FALSE".
Parameters:
value - value of the category
Since:
9.2.0

Category

public Category(java.lang.String value)
         throws InvalidArgumentException,
                ODMException
Creates a string Category instance with display name set to the value.
Parameters:
value - value of the category
Throws:
InvalidArgumentException
- - value is null
- value length > 64 characters
Since:
9.2.0

Category

public Category(java.lang.String displayName,
                int value)
         throws InvalidArgumentException,
                ODMException
Creates an int Category instance with the provided display name.
Parameters:
displayName - display name of the category
value - value of the category
Throws:
InvalidArgumentException
- - displayName is null
- displayName length > 256 characters
Since:
9.2.0

Category

public Category(java.lang.String displayName,
                float value)
         throws InvalidArgumentException,
                ODMException
Creates a float Category instance with the provided display name.
Parameters:
displayName - display name of the category
value - value of the category
Throws:
InvalidArgumentException
- - displayName is null
- displayName length > 256 characters
Since:
9.2.0

Category

public Category(java.lang.String displayName,
                java.lang.String value)
         throws InvalidArgumentException,
                ODMException
Creates a string Category instance with the provided display name.
Parameters:
displayName - display name of the category
value - value of the category
Throws:
InvalidArgumentException
- - value or type is null
- value length > 64 characters
- displayName or value is null
- displayName length or value length > 256 characters
Since:
9.2.0

Category

public Category(java.lang.String displayName,
                java.lang.String value,
                DataType dataType)
         throws InvalidArgumentException,
                ODMException
Creates a Category instance with the provided display name value and data type.
Parameters:
displayName - display name of the category
value - value of the category
dataType - data type of the category
Throws:
InvalidArgumentException
- - value or type is null
- value length > 64 characters
- displayName or value or dataType is null
- displayName length or value length > 256 characters
Method Detail

getValue

public java.lang.String getValue()
Returns the value of the Category.
Returns:
Category value

getDisplayName

public java.lang.String getDisplayName()
Returns the display name of the Category.
Returns:
Category display name

getDataType

public DataType getDataType()
Returns the data type of the Category.
Returns:
Category data type
Since:
9.2.0

toString

public java.lang.String toString()
Returns a formatted string representation of the Category instance.
Overrides:
toString in class java.lang.Object
Returns:
formatted string

equals

public boolean equals(Category cat)
Returns true if both categories have the same display name and value.
Parameters:
cat - Category
Returns:
true if both categories are the same