public class MemoryContainerAttrManager
extends java.lang.Object
MemoryContainer
as long as its implementation of getAttributes
and getAttrCount
methods works wrong when there are no attributes added to memory container.
First of mentioned method should return null
, while second one should returned zero in mentioned
case but, unfortunately, they both throw InvalidOperationException
. What is more - there is no method
allowing to check if attributes have been already set.Modifier and Type | Method | Description |
---|---|---|
static int |
getAttrCount(MemoryContainer memoryContainer) |
Gets quantity of attributes in memory container.
|
static Attribute[] |
getAttributes(MemoryContainer memoryContainer) |
Gets attrbiutes from mememory container.
|
static int |
getNumberOfTheOnlyActiveDecisionAttribute(MemoryContainer memoryContainer) |
Gets number of the only active decision attribute present in given memory container
or -1 if there is no exactly one active decision attribute
|
static int[] |
getNumbersOfActiveDecisionAttributes(Attribute[] attributes) |
Gets numbers of all active decision attributes present in given array of attributes
|
static int |
getQuantityOfActiveConditionCardinalGainCriteria(Attribute[] attributes) |
Gets quantity of active, condition (
attributes[i].getKind() == Attribute.NONE ),
cardinal (of type IntegerField , CardinalField or FloatField ) and gain
criteria (i.e. attributes with gain preference type assigned) from given array of attributes.Main goal of this method is to get the number of criteria that may be transformed to Lorenz evaluation space. |
static int |
getQuantityOfActiveDecisionAttributes(MemoryContainer memoryContainer) |
Gets quantity of active decision attributes in given memory container
|
static java.lang.String |
getSimpleAttributeValuesAsText(Field[] attributeValues) |
Converts given array of simple values of an attribute into
String . |
public static int getAttrCount(MemoryContainer memoryContainer)
InvalidOperationException
(thrown when attributes have not been set yet) by returning zero.memoryContainer
- reference to memory container for which quantity of attributes should be getjava.lang.NullPointerException
- when given memory container is null
public static Attribute[] getAttributes(MemoryContainer memoryContainer)
InvalidOperationException
(thrown when attributes have not been set yet) by returning null
.memoryContainer
- reference to memory container from which attributes should be getjava.lang.NullPointerException
- when given memory container is null
public static int getQuantityOfActiveDecisionAttributes(MemoryContainer memoryContainer)
memoryContainer
- memory container to testjava.lang.NullPointerException
- when given memory container is null
public static int getNumberOfTheOnlyActiveDecisionAttribute(MemoryContainer memoryContainer)
memoryContainer
- memory container to testjava.lang.NullPointerException
- when given memory container is null
public static int[] getNumbersOfActiveDecisionAttributes(Attribute[] attributes)
attributes
- array of attributes to search throughjava.lang.NullPointerException
- when given array of attributes is null
public static java.lang.String getSimpleAttributeValuesAsText(Field[] attributeValues)
String
.
If given array is null
or empty, then an empty string is returned.attributeValues
- array of simple values of an attributepublic static int getQuantityOfActiveConditionCardinalGainCriteria(Attribute[] attributes)
attributes[i].getKind() == Attribute.NONE
),
cardinal (of type IntegerField
, CardinalField
or FloatField
) and gain
criteria (i.e. attributes with gain preference type assigned) from given array of attributes.attributes
- array of attributes to search throughjava.lang.NullPointerException
- when given array of attributes is null