Main Page | Class Hierarchy | Class List | Class Members

kddml.Core.QueryElement.Condition.BaseCondition Class Reference

Inheritance diagram for kddml.Core.QueryElement.Condition.BaseCondition:

kddml.Core.QueryElement.Condition.Condition kddml.Core.QueryElement.XMLSpecialElement kddml.Core.QueryElement.Condition.ConditionChecker kddml.Core.QueryElement.Condition.ConditionResolver kddml.Core.KDDMLObject kddml.Core.HTMLTranslator kddml.Core.QueryElement.Condition.IF_CONDITION kddml.Core.QueryElement.Condition.IF_EXPRESSION_CONDITION kddml.Core.QueryElement.Condition.PP_MARKING_CONDITION kddml.Core.QueryElement.Condition.PP_REMOVE_ROWS_CONDITION kddml.Core.QueryElement.Condition.PP_REWRITING_CONDITION kddml.Core.QueryElement.Condition.RDA_FILTER_CONDITION kddml.Core.QueryElement.Condition.SEQUENCE_AGGREGATE_FILTER_CONDITION kddml.Core.QueryElement.Condition.SEQUENCE_FILTER_CONDITION List of all members.

Public Member Functions

 BaseCondition (String op_type, String term1, boolean term1_is_constant, String term2, boolean term2_is_constant, String term3, boolean term3_is_constant)
void checkConditionValidity () throws XMLSpecialElementException
BaseConditionDescr getConditionDescription () throws XMLSpecialElementException
boolean evalCond (weka.core.Instance instance, weka.core.Instance meta_instance) throws XMLSpecialElementException

Protected Member Functions

abstract boolean isMetaInstancesOperator ()
abstract boolean evalMissingAttribute ()
abstract boolean evalSimpleCase (String op, String[] values) throws XMLSpecialElementException
boolean evalEqual (String v1, String v2)
boolean evalNotEqual (String v1, String v2)
boolean evalGreater (String v1, String v2) throws XMLSpecialElementException
boolean evalGreaterOrEqual (String v1, String v2) throws XMLSpecialElementException
boolean evalLess (String v1, String v2) throws XMLSpecialElementException
boolean evalLessOrEqual (String v1, String v2) throws XMLSpecialElementException

Detailed Description

A primitive condition used to evaluate boolean operators (such as “not_equal”) on table attributes and/or constants. Here, table attributes stand both for relational (or preprocessing) table columns and model properties (e.g. the support of an association rule). Table attributes can be referred using the special symbol "@" in the value attribute. Each base condition can be expressed using the attribute op type, representing the name of the used boolean operator. Operators can be unary, binary or ternary expressed by the term1, term2, term3 fields.

Title: KDDML

Description: Knowledge Discovery in Database Environment

Copyright: Copyright (c) 2003-2005

Company: Universita' di Pisa - Dipartimento di Informatica

Author:
Andrea Romei (romei@di.unipi.it)
Version:
2.0.16


Constructor & Destructor Documentation

kddml.Core.QueryElement.Condition.BaseCondition.BaseCondition String  op_type,
String  term1,
boolean  term1_is_constant,
String  term2,
boolean  term2_is_constant,
String  term3,
boolean  term3_is_constant
 

Constructor.

Parameters:
op_type String the value of op_type attribute
term1 String the first term. Is null only if the operator is 0-ary.
term1_is_constant boolean true if the first term is a constant value. False if the first term is a table attribute.
term2 String the second term. Is null only if the operator is unary.
term2_is_constant boolean true if the second term is a constant value. False if the second term is a table attribute.
term3 String the third term. Is null only if the operator is binary.
term3_is_constant boolean true if the third term is a constant value. False if the third term is a table attribute.


Member Function Documentation

void kddml.Core.QueryElement.Condition.BaseCondition.checkConditionValidity  )  throws XMLSpecialElementException [virtual]
 

Checks the static correctness of this condition. In particular, for each primitive case of the condition, the method checks if the terms refere to a legal type as defined in the language DTDs and the operation type is supported. Throws an exception if some base term do not match the KDDML language DTDs. It checks if:

  1. the operator op_type is supported;
  2. the term attributes are not null for binary or ternary operators;
  3. every term is compatible.

Exceptions:
XMLSpecialElementException 

Implements kddml.Core.QueryElement.Condition.ConditionChecker.

BaseConditionDescr kddml.Core.QueryElement.Condition.BaseCondition.getConditionDescription  )  throws XMLSpecialElementException
 

Returns the class description for this base condition.

Exceptions:
XMLSpecialElementException 
Returns:
BaseConditionDescr

boolean kddml.Core.QueryElement.Condition.BaseCondition.evalCond weka.core.Instance  instance,
weka.core.Instance  meta_instance
throws XMLSpecialElementException
 

Evaluates this condition on input istance. Here, instance stand both for a relational tupla and a preprocessing tupla. In the first case, the field preprocessing_instance is null.

Parameters:
instance Instance the input instance for the relationa table. The input instance is defined in the weka.Core.Instance class. Cannot be null.
meta_instance Instance Instance the input preprocessing instance. The input instance is defined in the weka.Core.Instance class. Can be null.
Exceptions:
XMLSpecialElementException 
Returns:
boolean the evaluation of this condition.

Reimplemented in kddml.Core.QueryElement.Condition.PP_REWRITING_CONDITION.

abstract boolean kddml.Core.QueryElement.Condition.BaseCondition.isMetaInstancesOperator  )  [protected, pure virtual]
 

Returns false it the condition is evaluates on a table instance. Returns true if the op_type is evaluated on the preprocessing data, including preprocessing information such as marks associated to a physical instance value.

Returns:
boolean

Implemented in kddml.Core.QueryElement.Condition.IF_CONDITION, kddml.Core.QueryElement.Condition.IF_EXPRESSION_CONDITION, kddml.Core.QueryElement.Condition.PP_MARKING_CONDITION, kddml.Core.QueryElement.Condition.PP_REMOVE_ROWS_CONDITION, kddml.Core.QueryElement.Condition.PP_REWRITING_CONDITION, kddml.Core.QueryElement.Condition.RDA_FILTER_CONDITION, kddml.Core.QueryElement.Condition.SEQUENCE_AGGREGATE_FILTER_CONDITION, and kddml.Core.QueryElement.Condition.SEQUENCE_FILTER_CONDITION.

abstract boolean kddml.Core.QueryElement.Condition.BaseCondition.evalMissingAttribute  )  [protected, pure virtual]
 

Evaluates the condition if the attribute value is missing. Returns true if the condition is true when a missing attribute value is found. Returns false otherwise.

Returns:
boolean

Implemented in kddml.Core.QueryElement.Condition.IF_CONDITION, kddml.Core.QueryElement.Condition.IF_EXPRESSION_CONDITION, kddml.Core.QueryElement.Condition.PP_MARKING_CONDITION, kddml.Core.QueryElement.Condition.PP_REMOVE_ROWS_CONDITION, kddml.Core.QueryElement.Condition.PP_REWRITING_CONDITION, kddml.Core.QueryElement.Condition.RDA_FILTER_CONDITION, kddml.Core.QueryElement.Condition.SEQUENCE_AGGREGATE_FILTER_CONDITION, and kddml.Core.QueryElement.Condition.SEQUENCE_FILTER_CONDITION.

abstract boolean kddml.Core.QueryElement.Condition.BaseCondition.evalSimpleCase String  op,
String[]  values
throws XMLSpecialElementException [protected, pure virtual]
 

Evaluates a simple case expression.

Parameters:
op String the operator type.
values String[] the term values. The size of the array is equal to the cardinality of the op_type. If the value referes to a missing table attribute, then the array value is null.
Exceptions:
XMLSpecialElementException 
Returns:
boolean the condition evaluation.

Implemented in kddml.Core.QueryElement.Condition.IF_CONDITION, kddml.Core.QueryElement.Condition.IF_EXPRESSION_CONDITION, kddml.Core.QueryElement.Condition.PP_MARKING_CONDITION, kddml.Core.QueryElement.Condition.PP_REMOVE_ROWS_CONDITION, kddml.Core.QueryElement.Condition.PP_REWRITING_CONDITION, kddml.Core.QueryElement.Condition.RDA_FILTER_CONDITION, kddml.Core.QueryElement.Condition.SEQUENCE_AGGREGATE_FILTER_CONDITION, and kddml.Core.QueryElement.Condition.SEQUENCE_FILTER_CONDITION.

boolean kddml.Core.QueryElement.Condition.BaseCondition.evalEqual String  v1,
String  v2
[protected]
 

Evaluates the equal operator. Returns true if v1 = v2. It can be appled to numeric or string values.

Parameters:
v1 String
v2 String
Returns:
boolean

boolean kddml.Core.QueryElement.Condition.BaseCondition.evalNotEqual String  v1,
String  v2
[protected]
 

Evaluates the not_equal operator. Returns true if v1 != v2. It can be appled to numeric or string values.

Parameters:
v1 String
v2 String
Returns:
boolean

boolean kddml.Core.QueryElement.Condition.BaseCondition.evalGreater String  v1,
String  v2
throws XMLSpecialElementException [protected]
 

Evaluates the greater operator. Returns true if v1 > v2. It can be appled to numeric values only.

Parameters:
v1 String
v2 String
Exceptions:
XMLSpecialElementException 
Returns:
boolean

boolean kddml.Core.QueryElement.Condition.BaseCondition.evalGreaterOrEqual String  v1,
String  v2
throws XMLSpecialElementException [protected]
 

Evaluates the greater_or_equal operator. Returns true if v1 >= v2. It can be appled to numeric values only.

Parameters:
v1 String
v2 String
Exceptions:
XMLSpecialElementException 
Returns:
boolean

boolean kddml.Core.QueryElement.Condition.BaseCondition.evalLess String  v1,
String  v2
throws XMLSpecialElementException [protected]
 

Evaluates the less operator. Returns true if v1 < v2. It can be appled to numeric values only.

Parameters:
v1 String
v2 String
Exceptions:
XMLSpecialElementException 
Returns:
boolean

boolean kddml.Core.QueryElement.Condition.BaseCondition.evalLessOrEqual String  v1,
String  v2
throws XMLSpecialElementException [protected]
 

Evaluates the less_or_equal operator. Returns true if v1 <= v2. It can be appled to numeric values only.

Parameters:
v1 String
v2 String
Exceptions:
XMLSpecialElementException 
Returns:
boolean


Generated on Thu Feb 23 13:04:44 2006 for kddml by  doxygen 1.4.3