public class SimpleInstance<L> extends java.lang.Object implements INumericLabeledAttributeArrayInstance<L>
| Constructor and Description |
|---|
SimpleInstance(java.util.List<IAttributeValue<?>> attributeValues,
L targetValue) |
| Modifier and Type | Method and Description |
|---|---|
IAttributeValue<?>[] |
getAllAttributeValues() |
double[] |
getAsDoubleVector()
Turns the instance into a double vector.
|
IAttributeValue<java.lang.Double> |
getAttributeValue(int position) |
<T> IAttributeValue<T> |
getAttributeValueAtPosition(int position,
java.lang.Class<T> type)
Getter for the value of an attribute for the given position.
|
int |
getNumberOfAttributes()
Getter for the number of attributes for the instance.
|
L |
getTargetValue()
Getter for the value of the target attribute.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPointpublic SimpleInstance(java.util.List<IAttributeValue<?>> attributeValues, L targetValue)
public <T> IAttributeValue<T> getAttributeValueAtPosition(int position, java.lang.Class<T> type)
IAttributeArrayInstancegetAttributeValueAtPosition in interface IAttributeArrayInstanceposition - The position of the attribute within the instance.type - The type for which the attribute value shall be returned.public L getTargetValue()
ILabeledInstancegetTargetValue in interface ILabeledInstance<L>public double[] getAsDoubleVector()
throws ContainsNonNumericAttributesException
INumericArrayInstancegetAsDoubleVector in interface INumericArrayInstanceContainsNonNumericAttributesException - Thrown if the instance is to be converted into a double vector and still contains non-numeric attributes.public java.lang.String toString()
toString in class java.lang.Objectpublic IAttributeValue<java.lang.Double> getAttributeValue(int position)
getAttributeValue in interface INumericArrayInstancepublic IAttributeValue<?>[] getAllAttributeValues()
getAllAttributeValues in interface IAttributeArrayInstancepublic int getNumberOfAttributes()
IAttributeArrayInstancegetNumberOfAttributes in interface IAttributeArrayInstance