DecisionCondition
public class SingleCondition extends Condition implements DecisionCondition
SimpleField
.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_NOT_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 |
CONDITIONAL, DECISION
Constructor | Description |
---|---|
SingleCondition(AttributeInfo attributeInfo,
Relation relation) |
Constructs single condition with specified information about the attribute and relation.
|
Modifier and Type | Method | Description |
---|---|---|
static SingleCondition |
create(AttributeInfo attributeInfo,
SimpleField value,
int conditionType) |
Creates and returns single condition for given information about attribute and condition type,
created on the basis of given simple field value.
|
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.
|
Field |
getReferenceValue() |
|
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 CONDITION_ACCEPTING_NOT_EQUAL_VALUES
create
methodpublic SingleCondition(AttributeInfo attributeInfo, Relation relation)
SimpleField
RelationAtLeast
, RelationAtMost
, RelationGreaterThan
, RelationLessThan
, RelationEqual
or RelationNotEqual
- relation is different than null
SimpleField
)attributeInfo
- information about the attribute for which this condition is being definedrelation
- relation for this conditionInvalidValueException
- when attribute is not active or not conditional / not decision,InvalidTypeException
- when type of initial value of the attribute for which single condition is being defined is different than SimpleField
,
when relation is none of RelationAtLeast
, RelationAtMost
, RelationGreaterThan
, RelationLessThan
, RelationEqual
or RelationNotEqual
or when type of relation's reference value is different than type of 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 type of reference value for new relation is different than type of reference value for old relationpublic 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 examplepublic 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
SingleCondition
public static SingleCondition create(AttributeInfo attributeInfo, SimpleField value, int conditionType)
attributeInfo
- information about the attribute for which single condition is being createdvalue
- simple field value. These value will become reference value for relation.conditionType
- type of created single condition. Can be CONDITION_ACCEPTING_DOMINATING_VALUES
,
CONDITION_ACCEPTING_STRICTLY_DOMINATING_VALUES
, CONDITION_ACCEPTING_DOMINATED_VALUES
,
CONDITION_ACCEPTING_STRICTLY_DOMINATED_VALUES
, CONDITION_ACCEPTING_EQUAL_VALUES
or CONDITION_ACCEPTING_NOT_EQUAL_VALUES
.java.lang.NullPointerException
- when information about the attribute for which single condition is being created is null
or when given value 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
, CONDITION_ACCEPTING_EQUAL_VALUES
and CONDITION_ACCEPTING_NOT_EQUAL_VALUES
when attribute is not active (thrown by called SingleCondition
constructor)
or when attribute is not condition nor decision (thrown by called SingleCondition
constructor)InvalidTypeException
- when type of value of the attribute for which single condition is being created
is different than SimpleField
or when types of attribute's initial value and given value are differentpublic Field getReferenceValue()
getReferenceValue
in interface DecisionCondition
DecisionCondition.getReferenceValue()