Package com.groiss.ml.ds
Class Instance
java.lang.Object
com.groiss.ml.ds.Instance
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
getValueFor
(Attribute<T> attribute) Returns the value for the passed attribute for this instance<T> boolean
hasAttribute
(Attribute<T> attribute) Checks if this instance contains the passed attribute<T,
V extends T>
voidsetValueFor
(Attribute<T> attribute, V value) Sets the value for an attribute.
-
Constructor Details
-
Instance
public Instance()Create a new empty instance.
-
-
Method Details
-
setValueFor
Sets the value for an attribute.- Parameters:
attribute
- the attribute which value shall be setvalue
- the value for the attribute
-
hasAttribute
Checks if this instance contains the passed attribute- Parameters:
attribute
- theAttribute
to check for- Returns:
- true if this instance contains the attribute, false otherwise
-
getValueFor
Returns the value for the passed attribute for this instance- Parameters:
attribute
- theAttribute
which value is requested- Returns:
- the value of the passed attribute
-