public class SingleConditionForPairOfValues extends Condition
PairField
).
Each such single condition consists of information about the attribute (inherited from superclass),
reference to one relation and information about condition interpretation (if it is defined for first element in a pair,
for second element in a pair or if it describes dependency between first and second element in a pair).Modifier and Type | Field | Description |
---|---|---|
static int |
CONDITION_ACCEPTING_DOMINATED_VALUES |
Possible value of condition type for
create method |
static int |
CONDITION_ACCEPTING_DOMINATING_VALUES |
Possible value of condition type for
create method |
static int |
CONDITION_ACCEPTING_EQUAL_VALUES |
Possible value of condition type for
create method |
static int |
CONDITION_ACCEPTING_STRICTLY_DOMINATED_VALUES |
Possible value of condition type for
create method |
static int |
CONDITION_ACCEPTING_STRICTLY_DOMINATING_VALUES |
Possible value of condition type for
create method |
static int |
FIRST_ELEMENT_IN_PAIR |
Possible value of
conditionInterpretation used when this condition is defined for the first element in pair of values |
static int |
FIRST_VS_SECOND_ELEMENT_IN_PAIR |
Possible value of
conditionInterpretation used when this condition is fulfilled when some relation
between first and second element in pair of values is true. |
static int |
SECOND_ELEMENT_IN_PAIR |
Possible value of
conditionInterpretation used when this condition is defined for the second element in pair of values |
CONDITIONAL, DECISION
Constructor | Description |
---|---|
SingleConditionForPairOfValues(AttributeInfo attributeInfo,
Relation relation,
int conditionInterpretation) |
Constructs single condition for pair of values with specified information about the attribute, relation and interpretation.
|
Modifier and Type | Method | Description |
---|---|---|
static SingleConditionForPairOfValues |
create(AttributeInfo attributeInfo,
SimpleField value,
int conditionType,
int conditionInterpretation) |
Creates and returns single condition for pair of values for given information about attribute and condition type,
created on the basis of given simple field value, for given interpretation of condition
|
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 |
getConditionInterpretation() |
Gets interpretation of this condition.
|
Relation |
getRelation() |
Gets relation associated with this condition
|
void |
setRelation(Relation relation) |
Sets relation associated with this condition.
|
java.lang.String |
toString() |
Gets textual form of this condition.
|
getAttributeInfo
public static final int CONDITION_ACCEPTING_DOMINATING_VALUES
create
methodpublic static final int CONDITION_ACCEPTING_STRICTLY_DOMINATING_VALUES
create
methodpublic static final int CONDITION_ACCEPTING_DOMINATED_VALUES
create
methodpublic static final int CONDITION_ACCEPTING_STRICTLY_DOMINATED_VALUES
create
methodpublic static final int CONDITION_ACCEPTING_EQUAL_VALUES
create
methodpublic static final int FIRST_ELEMENT_IN_PAIR
conditionInterpretation
used when this condition is defined for the first element in pair of valuespublic static final int SECOND_ELEMENT_IN_PAIR
conditionInterpretation
used when this condition is defined for the second element in pair of valuespublic static final int FIRST_VS_SECOND_ELEMENT_IN_PAIR
conditionInterpretation
used when this condition is fulfilled when some relation
between first and second element in pair of values is true.public SingleConditionForPairOfValues(AttributeInfo attributeInfo, Relation relation, int conditionInterpretation)
PairField
null
FIRST_ELEMENT_IN_PAIR
, SECOND_ELEMENT_IN_PAIR
or FIRST_VS_SECOND_ELEMENT_IN_PAIR
- if relation is of type RelationAtLeast
, RelationAtMost
, RelationGreaterThan
, RelationLessThan
,
RelationAtLeastForPairOfValues
, RelationAtMostForPairOfValues
, RelationGreaterThanForPairOfValues
, RelationLessThanForPairOfValues
,
then attribute has preference type assignedRelationEqual
or RelationEqualForPairOfValues
,
then attribute has no preference type assignedFIRST_VS_SECOND_ELEMENT_IN_PAIR
, then type of relation's reference value
is the same as inner type of PairField
attribute for which this condition is being createdattributeInfo
- information about the attribute for which this condition is being definedrelation
- relation for this conditionconditionInterpretation
- interpretation of created single condition for pair of values.
Can be FIRST_ELEMENT_IN_PAIR
, SECOND_ELEMENT_IN_PAIR
or FIRST_VS_SECOND_ELEMENT_IN_PAIR
.InvalidValueException
- when attribute is not active or not conditional,
when given interpretation of the condition is none of FIRST_ELEMENT_IN_PAIR
,
SECOND_ELEMENT_IN_PAIR
and FIRST_VS_SECOND_ELEMENT_IN_PAIR
,
when attribute for which single condition for pair of values with relation >=, <=, > or < is being defined has no preference type assigned,
when attribute for which single condition for pair of values with one relation = is being defined has preference type assigned,
when condition interpretation is FIRST_VS_SECOND_ELEMENT_IN_PAIR
and relation is none of
RelationAtLeastForPairOfValues
, RelationAtMostForPairOfValues
,
RelationGreaterThanForPairOfValues
, RelationLessThanForPairOfValues
and RelationEqualForPairOfValues
,
when condition interpretation is different than FIRST_VS_SECOND_ELEMENT_IN_PAIR
and
relation is none of RelationAtLeast
, RelationAtMost
, RelationGreaterThan
,
RelationLessThan
and RelationEqual
,
when condition interpretation is FIRST_VS_SECOND_ELEMENT_IN_PAIR
and relation's reference value is not null
or when condition interpretation is not FIRST_VS_SECOND_ELEMENT_IN_PAIR
and relation's reference value is null
InvalidTypeException
- when type of initial value of the attribute for which single condition for pair of values is being defined is different than PairField
or when interpretation is different than FIRST_VS_SECOND_ELEMENT_IN_PAIR
and type of relation's reference value
is different than inner type of PairField
attribute's initial valuejava.lang.NullPointerException
- when relation is null
public Relation getRelation()
public void setRelation(Relation relation)
relation
- relation which will be associated with this conditionjava.lang.NullPointerException
- when relation is null
InvalidTypeException
- when type of new relation is different than type of old relation
or when condition interpretation is not FIRST_VS_SECOND_ELEMENT_IN_PAIR
and type of reference value for new relation is different than type of reference value for old relationInvalidValueException
- when reference value for new relation is not null
while
condition interpretation is FIRST_VS_SECOND_ELEMENT_IN_PAIR
or when reference value for new relation is null
while
condition interpretation is not FIRST_VS_SECOND_ELEMENT_IN_PAIR
public 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 null
java.lang.IndexOutOfBoundsException
- when attribute's number defined in condition is too big for given exampleInvalidTypeException
- when considered field value in given example is not of type PairField
public java.lang.String toString()
Condition.toString
method.
Uses information about the meaning of the attribute for which this condition is defined.public Condition duplicate()
Condition.duplicate
method.
Duplicates relation, but only copies reference to AttributeInfo
object.public boolean equals(java.lang.Object object)
null
SingleConditionForPairOfValues
FIRST_VS_SECOND_ELEMENT_IN_PAIR
and type of the reference value from other condition's relation is the same as type of the reference value
from this condition's relationFIRST_VS_SECOND_ELEMENT_IN_PAIR
and reference value from other condition's relation is equal to reference value from this condition's relationpublic static SingleConditionForPairOfValues create(AttributeInfo attributeInfo, SimpleField value, int conditionType, int conditionInterpretation)
attributeInfo
- information about the attribute for which single condition for pair of values is being createdvalue
- simple field value. These value will become reference value for relation if interpretation of created
single condition for pair of values is not FIRST_VS_SECOND_ELEMENT_IN_PAIR
.
Must be null
if conditionInterpretation
is FIRST_VS_SECOND_ELEMENT_IN_PAIR
.conditionType
- type of created single condition for pair of values. Can be CONDITION_ACCEPTING_DOMINATING_VALUES
,
CONDITION_ACCEPTING_STRICTLY_DOMINATING_VALUES
, CONDITION_ACCEPTING_DOMINATED_VALUES
,
CONDITION_ACCEPTING_STRICTLY_DOMINATED_VALUES
or CONDITION_ACCEPTING_EQUAL_VALUES
.conditionInterpretation
- interpretation of created single condition for pair of values.
Can be FIRST_ELEMENT_IN_PAIR
, SECOND_ELEMENT_IN_PAIR
or FIRST_VS_SECOND_ELEMENT_IN_PAIR
.java.lang.NullPointerException
- when information about the attribute for which single condition is being created is null
InvalidValueException
- when condition type is none of CONDITION_ACCEPTING_DOMINATING_VALUES
,
CONDITION_ACCEPTING_STRICTLY_DOMINATING_VALUES
, CONDITION_ACCEPTING_DOMINATED_VALUES
,
CONDITION_ACCEPTING_STRICTLY_DOMINATED_VALUES
and CONDITION_ACCEPTING_EQUAL_VALUES
,
when given interpretation of the condition is none of FIRST_ELEMENT_IN_PAIR
,
SECOND_ELEMENT_IN_PAIR
and FIRST_VS_SECOND_ELEMENT_IN_PAIR
,
when condition interpretation is not FIRST_VS_SECOND_ELEMENT_IN_PAIR
while value
is null
,
when condition interpretation is FIRST_VS_SECOND_ELEMENT_IN_PAIR
while value
is not null
,
when condition type involves values dominance check while attribute for which single condition for pair of values is being created
has no preference type assigned,
when condition type involves values equality check while attribute for which single condition for pair of values is being created
has preference type assigned,
when attribute for which single condition for pair of values is created is not active
or when attribute for which single condition for pair of values is created is not conditionalInvalidTypeException
- when type of initial value of the attribute for which single condition for pair of values is being created is different than PairField
or when condition interpretation is not FIRST_VS_SECOND_ELEMENT_IN_PAIR
and type of value
is different than inner type of PairField
attribute's initial valuepublic int getConditionInterpretation()
FIRST_ELEMENT_IN_PAIR
, SECOND_ELEMENT_IN_PAIR
or FIRST_VS_SECOND_ELEMENT_IN_PAIR
.