public class Condition
extends Object
A Condition is composed of 1..N Subconditions which are instances of the
Subcondition
class. It is the Subcondition that is associated
directly with a ResultHandle. The Condition defines how these Subconditions
are logically combined. The logicalOperator can be set to
Condition.ALL
or Condition.ANY
. The meaning is the
following:
logicalOperator | description |
---|---|
ALL | the condition is fulfilled if all Subconditions are fulfilled |
ANY | the condition is fulfilled as long as at least 1 Subcondition is fulfilled |
Condition.ANY
, the holdTime
defines for
how long a subcondition is regarded as violated. In detail, it is considered
violated in the time interval [t0 ; t0 + holdTime] where t0 is the time when
the violation occured.Modifier and Type | Field and Description |
---|---|
static String |
ALL
The logical operator ALL defines that the condition is fulfilled if all
subconditions are fulfilled.
|
static String |
ANY
The logical operator ANY defines that the condition is fulfilled as long
as at least 1 subcondition is fulfilled.
|
Constructor and Description |
---|
Condition()
Default constructor
|
Condition(String operator)
Constructs a new Condition with logical operator
operator |
Modifier and Type | Method and Description |
---|---|
Subcondition |
addSubcondition(ResultHandle resultHandle,
String comparator,
double value)
Creates a new Subcondition with the given parameters and adds it to this
Condition.
|
Subcondition |
addSubcondition(ResultHandle resultHandle,
String comparator,
float value)
Creates a new Subcondition with the given parameters and adds it to this
Condition.
|
Subcondition |
addSubcondition(Subcondition subCondition)
Adds a Subcondition.
|
String |
getDescription()
Gets the description.
|
double |
getHoldTime()
Gets the holdTime in [s].
|
int |
getID()
Gets the ID that identifies the Condition at the MINER core.
|
String |
getLogicalOperator()
Gets the logical operator.
|
Collection<Subcondition> |
getSubconditions()
Get all Subconditions.
|
void |
setDescription(String description)
Sets the description.
|
void |
setHoldTime(double holdTimeSec)
Sets the holdTime in [s].
|
void |
setLogicalOperator(String operator)
Sets the logical operator.
|
public static final String ANY
public static final String ALL
public Condition()
public Condition(String operator)
operator
operator
- the logical operatorpublic void setLogicalOperator(String operator)
operator
- the operatorIllegalArgumentException
- if an unknown operator is specified.public String getLogicalOperator()
public void setDescription(String description)
description
- the descriptionpublic String getDescription()
public void setHoldTime(double holdTimeSec)
holdTimeSec
- the holdTime in secondspublic double getHoldTime()
public Subcondition addSubcondition(ResultHandle resultHandle, String comparator, float value)
resultHandle
- The name of the result to which this subcondition is
associatedcomparator
- A comparator, i.e. one of "<", ">", "<=", ">=", "==", "!="value
- The value to compare topublic Subcondition addSubcondition(ResultHandle resultHandle, String comparator, double value)
resultHandle
- The name of the result to which this subcondition is
associatedcomparator
- A comparator, i.e. one of "<", ">", "<=", ">=", "==", "!="value
- The value to compare topublic Subcondition addSubcondition(Subcondition subCondition)
subCondition
- the SubconditionsubCondition
public Collection<Subcondition> getSubconditions()
public int getID()
Copyright (c) Salzburg Research Forschungsgesellschaft mbH. All rights reserved.