javax.datamining.data
Interface PhysicalDataRecord


public interface PhysicalDataRecord

A PhysicalDataRecord represents a record as a set of name-value pairs and enables singleton record scoring. Users can set specific values for PhysicalAttribute instances. It is a light-weight object that performs no validation of inputs, e.g., attribute name uniqueness or value type checking.

Author:
JSR-73 Java Data Mining Expert Group

Method Summary
 int getAttributeCount()
          Returns the number of attributes contained.
 java.util.Collection getAttributeNames()
          Returns a collection of attribute names present in the physical record.
 java.lang.Object getValue(java.lang.String attributeName)
          Returns the object value of the specified attribute.
 void removeAllAttributes()
          Removes all attribute-value pairs currently associated with the PhysicalDataRecord instance.
 void removeAttribute(java.lang.String attributeName)
          Removes the specified attribute from the physical record.
 void resetValues()
          Resets all values associated with the attributes to null.
 void setValue(java.lang.String attributeName, java.lang.Object value)
          Sets the value of the named attribute with the specified object value.
 

Method Detail

getAttributeCount

public int getAttributeCount()
Returns the number of attributes contained.

Returns:
int

getAttributeNames

public java.util.Collection getAttributeNames()
Returns a collection of attribute names present in the physical record.

Returns:
Collection

getValue

public java.lang.Object getValue(java.lang.String attributeName)
                          throws JDMException
Returns the object value of the specified attribute. If the attribute is not found, an exception is thrown.

The object will be of type Integer, String, Double, or null for missing value.

Parameters:
attributeName - The name of the physical attribute whose value in the record is to be returned.
Returns:
Object
Throws:
JDMException

removeAllAttributes

public void removeAllAttributes()
Removes all attribute-value pairs currently associated with the PhysicalDataRecord instance.

Returns:
void

removeAttribute

public void removeAttribute(java.lang.String attributeName)
                     throws JDMException
Removes the specified attribute from the physical record. The associated value is also removed altogether.

If name is not found, an exception is thrown.

Parameters:
attributeName - The name of the attribute to be removed.
Returns:
void
Throws:
JDMException

resetValues

public void resetValues()
Resets all values associated with the attributes to null.

Returns:
void

setValue

public void setValue(java.lang.String attributeName,
                     java.lang.Object value)
              throws JDMException
Sets the value of the named attribute with the specified object value. A null value indicates that the attribute has no value, i.e., missing value.

If the specified attribute is not found in the list of attributes, it is added to the list.

Valid object types are Integer, String, Double, and null.

Parameters:
attributeName - The name of the attribute whose value is to be assigned.
value - The value of the attribute.
Returns:
void
Throws:
JDMException