AP&C API Reference
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
Apac.Logic.PredicateExpression Class Reference

This class defines an expression that can be used in building a predicate, either alone or in conjunction with other expressions. Each expression consists of a variable name, which is the source of the data to be compared (ie: column name, property name, whatever), an operator (>, <, etc), and a comparison value. More...

Inheritance diagram for Apac.Logic.PredicateExpression:

Public Member Functions

bool IsExpressionValid (PredicateExpression expression)
 Allows a caller to validate the qualifier value with the variable type. More...
 
 PredicateExpression ()
 Creates an empty expression. Use the properties to set it up. More...
 
 PredicateExpression (string variable, PredicateOperators op, string qualifier, System.Data.DbType variableType)
 Creates a new predicate expression. More...
 
override string ToString ()
 Returns a string reprentation of the expression in a form similar to that used for T-SQL. For a standard binary operator the format is 'variable operator qualifier'. More...
 
System.Xml.Schema.XmlSchema GetSchema ()
 Returns null. More...
 
void ReadXml (System.Xml.XmlReader reader)
 Deserializes the expression from the XmlReader. More...
 
void WriteXml (System.Xml.XmlWriter writer)
 Serializes the expression into the XmlWriter. More...
 
void GetObjectData (SerializationInfo info, StreamingContext context)
 Serializes (binary) a predicate set. More...
 

Static Public Member Functions

static PredicateOperators[] GetOperators (System.Data.DbType dataType)
 Gets the operators that can be used with the data types that define the system's fields. More...
 
static PredicateExpression FromString (string expression)
 

Static Public Attributes

static readonly PredicateExpression And = null
 The instance of predicate expression representing a logical AND for conjunctive sets. More...
 
static readonly PredicateExpression Or = null
 The instance of predicate expression representing a logical OR for conjunctive sets. More...
 
static readonly PredicateExpression BeginPrecedence = null
 The instance of predicate expression representing the beginning of a precedence block (parentheses in SQL). More...
 
static readonly PredicateExpression EndPrecedence = null
 The instance of predicate expression representing the ending of a precedence block (parentheses in SQL). More...
 

Protected Member Functions

 PredicateExpression (SerializationInfo info, StreamingContext context)
 Deserializes a predicate expression. More...
 

Properties

object Tag [get, set]
 Arbitrary value useful to consumers that might need to track an individual expression for later identification. More...
 
int PrecedenceLevel [get, set]
 Gets or sets (internal only) the precedence level. More...
 
string Variable [get, set]
 The name of the variable being tested. The value must be alphanumeric and cannot be null or empty. More...
 
string VariableDisplay [get, set]
 The user friendly name of the variable being tested. More...
 
PredicateOperators Operator [get, set]
 The operator used against the variable and the qualifier. More...
 
string Qualifier [get, set]
 The qualifier used to test the variable. For some operators this value may be ignored. More...
 
System.Data.DbType VariableType [get, set]
 The data type of the variable. More...
 
bool IsAnd [get]
 A helper used to determine if this expression is the And constant. More...
 
bool IsOr [get]
 A helper used to determine if this expression is the Or constant. More...
 
bool IsBeginPrecedence [get]
 A helper used to determine if this expression is the BeginPredence constant. More...
 
bool IsEndPrecedence [get]
 A helper used to determine if this expression is the EndPredence constant. More...
 

Detailed Description

This class defines an expression that can be used in building a predicate, either alone or in conjunction with other expressions. Each expression consists of a variable name, which is the source of the data to be compared (ie: column name, property name, whatever), an operator (>, <, etc), and a comparison value.

Constructor & Destructor Documentation

◆ PredicateExpression() [1/3]

Apac.Logic.PredicateExpression.PredicateExpression ( )
inline

Creates an empty expression. Use the properties to set it up.


◆ PredicateExpression() [2/3]

Apac.Logic.PredicateExpression.PredicateExpression ( SerializationInfo  info,
StreamingContext  context 
)
inlineprotected

Deserializes a predicate expression.

Parameters
infoSee SerializationInfo.
contextSee StreamingContext.

◆ PredicateExpression() [3/3]

Apac.Logic.PredicateExpression.PredicateExpression ( string  variable,
PredicateOperators  op,
string  qualifier,
System.Data.DbType  variableType 
)
inline

Creates a new predicate expression.

Parameters
variableSee Variable.
opSee Operator.
qualifierSee Qualifier.

Member Function Documentation

◆ GetObjectData()

void Apac.Logic.PredicateExpression.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inline

Serializes (binary) a predicate set.

Parameters
infoSee SerializationInfo.
contextSee StreamingContext.

◆ GetOperators()

static PredicateOperators [] Apac.Logic.PredicateExpression.GetOperators ( System.Data.DbType  dataType)
inlinestatic

Gets the operators that can be used with the data types that define the system's fields.

Parameters
dataTypeThe type of data for which operators are needed.
Returns
Returns an array of PredicateOperators that can be used against the give data type.

◆ GetSchema()

System.Xml.Schema.XmlSchema Apac.Logic.PredicateExpression.GetSchema ( )
inline

Returns null.

Returns
Returns null.

◆ IsExpressionValid()

bool Apac.Logic.PredicateExpression.IsExpressionValid ( PredicateExpression  expression)
inline

Allows a caller to validate the qualifier value with the variable type.

Parameters
expressionThe expression to be checked.
Returns
Returns true if the qualifier works with the variable type, false if it doesn't.

◆ ReadXml()

void Apac.Logic.PredicateExpression.ReadXml ( System.Xml.XmlReader  reader)
inline

Deserializes the expression from the XmlReader.

Parameters
readerThe reader from which the data is read.

◆ ToString()

override string Apac.Logic.PredicateExpression.ToString ( )
inline

Returns a string reprentation of the expression in a form similar to that used for T-SQL. For a standard binary operator the format is 'variable operator qualifier'.

Returns

◆ WriteXml()

void Apac.Logic.PredicateExpression.WriteXml ( System.Xml.XmlWriter  writer)
inline

Serializes the expression into the XmlWriter.

Parameters
writerThe writer into which the data will be serialized.

Member Data Documentation

◆ And

readonly PredicateExpression Apac.Logic.PredicateExpression.And = null
static

The instance of predicate expression representing a logical AND for conjunctive sets.

◆ BeginPrecedence

readonly PredicateExpression Apac.Logic.PredicateExpression.BeginPrecedence = null
static

The instance of predicate expression representing the beginning of a precedence block (parentheses in SQL).

◆ EndPrecedence

readonly PredicateExpression Apac.Logic.PredicateExpression.EndPrecedence = null
static

The instance of predicate expression representing the ending of a precedence block (parentheses in SQL).

◆ Or

readonly PredicateExpression Apac.Logic.PredicateExpression.Or = null
static

The instance of predicate expression representing a logical OR for conjunctive sets.

Property Documentation

◆ IsAnd

bool Apac.Logic.PredicateExpression.IsAnd
get

A helper used to determine if this expression is the And constant.

◆ IsBeginPrecedence

bool Apac.Logic.PredicateExpression.IsBeginPrecedence
get

A helper used to determine if this expression is the BeginPredence constant.

◆ IsEndPrecedence

bool Apac.Logic.PredicateExpression.IsEndPrecedence
get

A helper used to determine if this expression is the EndPredence constant.

◆ IsOr

bool Apac.Logic.PredicateExpression.IsOr
get

A helper used to determine if this expression is the Or constant.

◆ Operator

PredicateOperators Apac.Logic.PredicateExpression.Operator
getset

The operator used against the variable and the qualifier.

◆ PrecedenceLevel

int Apac.Logic.PredicateExpression.PrecedenceLevel
getset

Gets or sets (internal only) the precedence level.

The precedence level.

◆ Qualifier

string Apac.Logic.PredicateExpression.Qualifier
getset

The qualifier used to test the variable. For some operators this value may be ignored.

◆ Tag

object Apac.Logic.PredicateExpression.Tag
getset

Arbitrary value useful to consumers that might need to track an individual expression for later identification.

◆ Variable

string Apac.Logic.PredicateExpression.Variable
getset

The name of the variable being tested. The value must be alphanumeric and cannot be null or empty.

◆ VariableDisplay

string Apac.Logic.PredicateExpression.VariableDisplay
getset

The user friendly name of the variable being tested.

◆ VariableType

System.Data.DbType Apac.Logic.PredicateExpression.VariableType
getset

The data type of the variable.


The documentation for this class was generated from the following file: