DecisionCondition
public class PairCondition extends Condition implements DecisionCondition
PairField
.
Such condition may accept either dominating or dominated pairs of simple values.
See PairField.checkDominance
method for details.
Pair of values may be found in PCT, when comparing two examples on ordinal criterion.Modifier and Type | Field | Description |
---|---|---|
static int |
CONDITION_ACCEPTING_DOMINATED_PAIRS |
Possible value of condition type
|
static int |
CONDITION_ACCEPTING_DOMINATING_PAIRS |
Possible value of condition type
|
static int |
CONDITION_ACCEPTING_EQUAL_PAIRS |
Possible value of condition type
|
CONDITIONAL, DECISION
Constructor | Description |
---|---|
PairCondition(AttributeInfo attributeInfo,
PairField referencePair,
int conditionType) |
Constructs pair condition with specified information about the attribute, reference pair of simple values
and type of condition.
|
Modifier and Type | Method | Description |
---|---|---|
static PairCondition |
create(AttributeInfo attributeInfo,
PairField referencePair,
int conditionType) |
Creates and returns pair condition for given information about attribute and condition type,
created on the basis of given reference pair of simple field values
|
java.util.ArrayList<SingleConditionForPairOfValues[]> |
decomposeToSingleConditionsForPairOfValues() |
Decomposes this pair condition to the set of single conditions for pair of values (
SingleConditionForPairOfValue objects). |
Condition |
duplicate() |
Returns duplicate of this condition.
|
boolean |
equals(java.lang.Object object) |
Checks if given object is a condition equal to this condition.
|
boolean |
fulfilledBy(Example example) |
Checks if given example fulfills this condition.
|
int |
getConditionType() |
Gets type of this condition
|
PairField |
getReferencePair() |
Gets reference pair of simple values for which this condition has been created.
|
Field |
getReferenceValue() |
|
java.lang.String |
toString() |
Gets textual form of this condition.
|
getAttributeInfo
public static final int CONDITION_ACCEPTING_DOMINATING_PAIRS
public static final int CONDITION_ACCEPTING_DOMINATED_PAIRS
public static final int CONDITION_ACCEPTING_EQUAL_PAIRS
public PairCondition(AttributeInfo attributeInfo, PairField referencePair, int conditionType)
attributeInfo
- information about the attribute for which this condition is being createdreferencePair
- reference pair of simple field values which will be stored in this conditionconditionType
- Type of created pair condition which will be stored in this condition.
Can be CONDITION_ACCEPTING_DOMINATING_PAIRS
, CONDITION_ACCEPTING_DOMINATED_PAIRS
or CONDITION_ACCEPTING_EQUAL_PAIRS
.java.lang.NullPointerException
- when information about the attribute for which pair condition is being created is null
or when given pair of values is null
InvalidValueException
- when condition type is none of CONDITION_ACCEPTING_DOMINATING_PAIRS
,
CONDITION_ACCEPTING_DOMINATED_PAIRS
and CONDITION_ACCEPTING_EQUAL_PAIRS
,
when condition type involves pairs dominance check while attribute for which pair condition is being created
has no preference type assigned,
when condition type involves pairs equality check while attribute for which pair condition is being created
has preference type assigned,
when attribute is not active,
or when respective attribute is neither condition nor decision oneInvalidTypeException
- when type of value of the attribute for which pair condition is being created
is different than PairField
or when inner type of given pair is different than inner type of PairField
attribute
for which pair condition is being createdpublic boolean fulfilledBy(Example example)
Condition.fulfilledBy
abstract method.fulfilledBy
in class Condition
example
- example to checktrue
if given example fulfills this condition, false
otherwisejava.lang.NullPointerException
- when example is nulljava.lang.IndexOutOfBoundsException
- when attribute's number defined in this condition is too big for given exampleInvalidTypeException
- when type of considered example's field is not PairField
or when inner type for PairField
field from example is different than inner type
for PairField
attribute for which this condition is definedpublic java.lang.String toString()
Condition.toString
method.public Condition duplicate()
Condition.duplicate
method.
Duplicates reference pair, but only copies reference to AttributeInfo
object.public boolean equals(java.lang.Object object)
null
PairCondition
conditionType
field) is the same as type of this conditionpublic int getConditionType()
public PairField getReferencePair()
public static PairCondition create(AttributeInfo attributeInfo, PairField referencePair, int conditionType)
attributeInfo
- information about the attribute for which pair condition is being createdreferencePair
- reference pair of simple field values which will be stored in returned pair conditionconditionType
- Type of created pair condition. Can be CONDITION_ACCEPTING_DOMINATING_PAIRS
,
CONDITION_ACCEPTING_DOMINATED_PAIRS
or CONDITION_ACCEPTING_EQUAL_PAIRS
.java.lang.NullPointerException
- when information about the attribute for which pair condition is being created is null
or when given pair of values is null
InvalidValueException
- when condition type is none of CONDITION_ACCEPTING_DOMINATING_PAIRS
,
CONDITION_ACCEPTING_DOMINATED_PAIRS
and CONDITION_ACCEPTING_EQUAL_PAIRS
,
when condition type involves pairs dominance check while attribute for which pair condition is being created
has no preference type assigned,
when condition type involves pairs equality check while attribute for which pair condition is being created
has preference type assigned,
when attribute is not active (thrown by called PairCondition
constructor)
or when attribute is not conditional (thrown by called PairCondition
constructor)InvalidTypeException
- when type of value of the attribute for which pair condition is being created
is different than PairField
or when inner type of given pair is different than inner type of PairField
attribute
for which pair condition is being createdpublic java.util.ArrayList<SingleConditionForPairOfValues[]> decomposeToSingleConditionsForPairOfValues()
SingleConditionForPairOfValue
objects).
Takes into account value of PairField.getDominanceCheckMethod()
method.SingleConditionForPairOfValues[]
tables.
Each table includes conditions connected by means of 'and' conjunction,
while between tables there is an 'or' conjunction.
First (0-indexed) table is always present in the resulting list (and includes 2 conditions).
Second (1-indexed) table may be not present if there is no 'or' among single conditions for pair of values.public Field getReferenceValue()
getReferenceValue
in interface DecisionCondition
DecisionCondition.getReferenceValue()