org.jclarion.clarion.runtime.expr
Class BoolExpr

java.lang.Object
  extended by org.jclarion.clarion.runtime.expr.CExpr
      extended by org.jclarion.clarion.runtime.expr.BoolExpr

public class BoolExpr
extends CExpr


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jclarion.clarion.runtime.expr.CExpr
CExpr.DeepIterator, CExpr.GenericOp, CExpr.JoinIterator, CExpr.OneIterator, CExpr.OpIterable, CExpr.OpIterator, CExpr.TwoIterator, CExpr.ZeroIterator
 
Constructor Summary
BoolExpr(CExpr base)
           
 
Method Summary
 void add(java.lang.String op, CExpr right)
           
 void cast(CExprType type)
          Force expr type to a new cast
static CExpr construct(CExpr left, java.lang.String op, CExpr right)
           
 java.util.Iterator<CExpr> directChildren()
           
 ClarionObject eval()
          Generate result
 boolean generateString(java.lang.StringBuilder out, boolean strict)
          In strict mode - we are not allowed to generate SQL if either side of an OR expression is not strict too.
 CExprType getType()
          Work out expression type
 boolean isRecastableType()
          Return whether or not expression type is fixed.
 int precendence()
          Return order of precendence.
 
Methods inherited from class org.jclarion.clarion.runtime.expr.CExpr
cast, isRecastableType, iterator, resolveCasts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoolExpr

public BoolExpr(CExpr base)
Method Detail

construct

public static CExpr construct(CExpr left,
                              java.lang.String op,
                              CExpr right)

add

public void add(java.lang.String op,
                CExpr right)

eval

public ClarionObject eval()
Description copied from class: CExpr
Generate result

Specified by:
eval in class CExpr
Returns:

precendence

public int precendence()
Description copied from class: CExpr
Return order of precendence. Low number = low order of precedence (i.e. bool etc) Hi number = high order of precendence (i.e. * % / etc ). Highest is constants When rebuilding expressions (i.e. SQL) you need to paran anything whose precendence is lower then yourself i.e. Sum(Prod,Prod) = 2*3 + 6*3 Prod(Sum,Sum) = (2+3) * (6+3)

Specified by:
precendence in class CExpr

directChildren

public java.util.Iterator<CExpr> directChildren()
Specified by:
directChildren in class CExpr

generateString

public boolean generateString(java.lang.StringBuilder out,
                              boolean strict)
In strict mode - we are not allowed to generate SQL if either side of an OR expression is not strict too. but everything else is ok. ie following scenarios are ok S1 AND C2 AND S3 * S1 AND S3 S1 OR C2 AND S3 * S3 C1 OR S2 AND S3 * S3 C1 OR S2 AND S3 OR C4 *

Specified by:
generateString in class CExpr

cast

public void cast(CExprType type)
Description copied from class: CExpr
Force expr type to a new cast

Specified by:
cast in class CExpr

getType

public CExprType getType()
Description copied from class: CExpr
Work out expression type

Specified by:
getType in class CExpr
Returns:

isRecastableType

public boolean isRecastableType()
Description copied from class: CExpr
Return whether or not expression type is fixed. i.e. cannot be easily recast

Specified by:
isRecastableType in class CExpr


Copyright © 2010. All Rights Reserved.