Oracle Data Mining Java API Reference
10g Release 1 (10.1)

B12276-01

oracle.dmt.odm
Class CategorySet

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

public class CategorySet
extends MiningObject

An instance of CategorySet represents a group of categories associated with a single mining attribute.

Since:
10iR1
See Also:
Serialized Form

Constructor Summary
CategorySet(java.lang.String name, DataType type)
          Creates a CategorySet instance accepting the name and the datatype.

 

Method Summary
 int addCategory(java.lang.Object categoryValue)
          Adds a Category to the CategorySet.
 int addCategory(java.lang.String name, java.lang.Object categoryValue)
          Adds a Category to the CategorySet.
 Category[] getCategories()
          Gets the list of categories from the CategorySet.
 Category getCategory(int index)
          Gets a single category ( at the specified index) from the CategorySet.
 int getCategoryIndex(java.lang.Object value)
          Returns the index for the category containing the incoming value
 DataType getDataType()
          Returns the data type for the current CategorySet
 java.lang.String getName()
          Returns the name of the curret CategorySet
 void removeCategory(int index)
          Removes a category from the CategorySet.
 void setCategoryArray(Category[] listOfCategories)
          Sets the list of categories

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

CategorySet

public CategorySet(java.lang.String name,
DataType type)
            throws InvalidArgumentException,
ODMException
Creates a CategorySet instance accepting the name and the datatype. Categories must be added separately.
Throws:
ODMException - if name more than 30 characters.
InvalidArgumentException - if name is null.
Method Detail

addCategory

public int addCategory(java.lang.Object categoryValue)
                throws InvalidArgumentException,
ODMException
Adds a Category to the CategorySet. DataType is deduced from the Object (CategoryValue) that is passed in. Only Integer, Float, Boolean and String are valid as datatype for the Category
Throws:
InvalidArgumentException - if the value is not of type Integer, Float, String or Boolean.
ODMException - if the value is longer than 4000 characters.

addCategory

public int addCategory(java.lang.String name,
                       java.lang.Object categoryValue)
                throws InvalidArgumentException,
ODMException
Adds a Category to the CategorySet. DataType is deduced from the Object (CategoryValue) that is passed in. Only Integer, Float, Boolean and String are valid as datatype for the Category
Throws:
InvalidArgumentException - if the value is not of type Integer, Float, String or Boolean
ODMException

removeCategory

public void removeCategory(int index)
                    throws java.lang.ArrayIndexOutOfBoundsException
Removes a category from the CategorySet. If an object in the middle is removed, the set will be repacked. So all the indices after the current index (that is removed) will be off by 1.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is less 0 or beyond the max number of categories in the set

getCategory

public Category getCategory(int index)
                                    throws java.lang.ArrayIndexOutOfBoundsException
Gets a single category ( at the specified index) from the CategorySet.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is 0 or beyond the max number of categories in the set

getCategories

public Category[] getCategories()
Gets the list of categories from the CategorySet.
Throws:
InvalidArgumentException - if the index is 0 or beyond the max number of categories in the set

getCategoryIndex

public int getCategoryIndex(java.lang.Object value)
                     throws ODMException
Returns the index for the category containing the incoming value
Throws:
ODMException - if the category value is longer than 4000 characters

getName

public java.lang.String getName()
Returns the name of the curret CategorySet

getDataType

public DataType getDataType()
Returns the data type for the current CategorySet

setCategoryArray

public void setCategoryArray(Category[] listOfCategories)
                      throws InvalidArgumentException,
ODMException
Sets the list of categories
Throws:
InvalidArgumentException - if the array is null or empty.
ODMException - if the category value is longer than 4000 characters.

Copyright © 2003 Oracle Corporation. All Rights Reserved.