public class MemoryContainerDecisionsManager
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.String |
getDecisionAttributeName(MemoryContainer memoryContainer) |
Gets name of the only active decision attribute from given memory container.
|
static Field[] |
getDecisionAttributeValues(MemoryContainer memoryContainer) |
Gets ordered list of all values of decision attribute present in given memory container.
|
static Field[] |
getDecisionAttributeValues(MemoryContainer memoryContainer,
int decisionAttributeNumber) |
Gets ordered list of all unique values of decision attribute present in given memory container.
|
static java.lang.String |
getDecisionAttributeValuesAsText(MemoryContainer memoryContainer) |
Gets ordered list of all values of decision attribute, present in given memory container,
in textual form.
|
static int |
getFirstDecisionAttributeIndex(MemoryContainer memoryContainer) |
Gets index of the first active decision attribute from given memory container.
|
static Field[] |
sortAndUniquifyDecisionAttributeValues(Field[] decisionAttributeValues,
int decisionAttributePreferenceType) |
Sorts given array of decision attribute values, ensuring at the same time that each value will be present only once in the resulting array.
|
public static java.lang.String getDecisionAttributeName(MemoryContainer memoryContainer)
null.memoryContainer - reference to considered memory containernull if there is no exactly
one active decision attributejava.lang.NullPointerException - when memory container is nullInvalidValueException - when memory container contains no attributes or no examplespublic static int getFirstDecisionAttributeIndex(MemoryContainer memoryContainer)
-1.memoryContainer - reference to considered memory container-1 if given memory container contains no active decision attributejava.lang.NullPointerException - when memory container is nullInvalidValueException - when memory container contains no attributes or no examplespublic static java.lang.String getDecisionAttributeValuesAsText(MemoryContainer memoryContainer)
Field.compareTo).
Values are separated by ", " separators.
If there is no exactly one active decision attribute, then returns null.memoryContainer - reference to considered memory containernull
if there is no exactly one active decision attributejava.lang.NullPointerException - when memory container is nullInvalidValueException - when memory container contains no attributes or no examplespublic static Field[] getDecisionAttributeValues(MemoryContainer memoryContainer)
Field.compareTo).
If there is no exactly one active decision attribute, then returns null.memoryContainer - reference to considered memory containernull
if there is no exactly one active decision attributejava.lang.NullPointerException - when memory container is nullInvalidValueException - when memory container contains no attributes or no examplespublic static Field[] sortAndUniquifyDecisionAttributeValues(Field[] decisionAttributeValues, int decisionAttributePreferenceType)
decisionAttributeValues - array with decision attribute values observed in a memory container or a rules container, possibly containing duplicates.decisionAttributePreferenceType - preference type of considered decision attribute (whose values are given in the array being the first parameter)InvalidValueException - when given decision attribute preference type is none of Attribute.GAIN, Attribute.COST, and Attribute.NONEpublic static Field[] getDecisionAttributeValues(MemoryContainer memoryContainer, int decisionAttributeNumber)
Field.compareTo).memoryContainer - reference to considered memory containerdecisionAttributeNumber - number of considered active decision attributejava.lang.NullPointerException - when memory container is nullInvalidValueException - when memory container contains no attributes or no examples
or when number of decision attribute is incorrect - attribute with given number is not active or not decisionjava.lang.IndexOutOfBoundsException - when decision attribute number is too small or too big for given memory container