com.caucho.amber.expr
Class AndExpr

java.lang.Object
  extended by com.caucho.amber.expr.AbstractAmberExpr
      extended by com.caucho.amber.expr.AndExpr
All Implemented Interfaces:
AmberExpr

public class AndExpr
extends AbstractAmberExpr

A conjunction.


Field Summary
 
Fields inherited from interface com.caucho.amber.expr.AmberExpr
IS_INNER_JOIN, USES_DATA
 
Constructor Summary
AndExpr()
           
 
Method Summary
 void add(AmberExpr expr)
          Adds a new component.
 AmberExpr bindSelect(QueryParser parser)
          Binds the expression as a select item.
static AmberExpr create(AmberExpr left, AmberExpr right)
          Creates the and.
 boolean exists(FromItem from)
          Returns true if the from item is used in the expression
 void generateHaving(CharBuffer cb)
          Generates the having expression.
 void generateJoin(CharBuffer cb)
          Generates the join expression.
 void generateUpdateWhere(CharBuffer cb)
          Generates the (update) where expression.
 void generateWhere(CharBuffer cb)
          Generates the where expression.
 java.util.ArrayList<AmberExpr> getComponents()
          Returns the components.
 AmberExpr getSingle()
          Returns a single expression.
 boolean isBoolean()
          Returns true for a boolean expression.
 AmberExpr replaceJoin(JoinExpr join)
          Returns true if the expression uses the from item.
 void setInternalArgType(AmberExpr other)
          Binds the argument type based on another expr.
 boolean usesFrom(FromItem from, int type, boolean isNot)
          Returns true if the expression uses the from item.
 
Methods inherited from class com.caucho.amber.expr.AbstractAmberExpr
createBoolean, exists, findItem, generateSelect, getCacheObject, getColumnCount, getObject, getType, hasRelationship, usesFrom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndExpr

public AndExpr()
Method Detail

create

public static AmberExpr create(AmberExpr left,
                               AmberExpr right)
                        throws QueryParseException
Creates the and.

Throws:
QueryParseException

isBoolean

public boolean isBoolean()
Returns true for a boolean expression.

Specified by:
isBoolean in interface AmberExpr
Overrides:
isBoolean in class AbstractAmberExpr

add

public void add(AmberExpr expr)
Adds a new component.


getComponents

public java.util.ArrayList<AmberExpr> getComponents()
Returns the components.


bindSelect

public AmberExpr bindSelect(QueryParser parser)
Binds the expression as a select item.

Specified by:
bindSelect in interface AmberExpr
Specified by:
bindSelect in class AbstractAmberExpr

getSingle

public AmberExpr getSingle()
Returns a single expression.


usesFrom

public boolean usesFrom(FromItem from,
                        int type,
                        boolean isNot)
Returns true if the expression uses the from item.

Specified by:
usesFrom in interface AmberExpr
Overrides:
usesFrom in class AbstractAmberExpr

exists

public boolean exists(FromItem from)
Returns true if the from item is used in the expression

Specified by:
exists in interface AmberExpr
Overrides:
exists in class AbstractAmberExpr

replaceJoin

public AmberExpr replaceJoin(JoinExpr join)
Returns true if the expression uses the from item.

Specified by:
replaceJoin in interface AmberExpr
Overrides:
replaceJoin in class AbstractAmberExpr

generateWhere

public void generateWhere(CharBuffer cb)
Generates the where expression.

Specified by:
generateWhere in interface AmberExpr
Overrides:
generateWhere in class AbstractAmberExpr

generateUpdateWhere

public void generateUpdateWhere(CharBuffer cb)
Generates the (update) where expression.

Specified by:
generateUpdateWhere in interface AmberExpr
Overrides:
generateUpdateWhere in class AbstractAmberExpr

generateHaving

public void generateHaving(CharBuffer cb)
Generates the having expression.

Specified by:
generateHaving in interface AmberExpr
Overrides:
generateHaving in class AbstractAmberExpr

generateJoin

public void generateJoin(CharBuffer cb)
Generates the join expression.

Specified by:
generateJoin in interface AmberExpr
Overrides:
generateJoin in class AbstractAmberExpr

setInternalArgType

public void setInternalArgType(AmberExpr other)
Binds the argument type based on another expr.

Specified by:
setInternalArgType in interface AmberExpr
Overrides:
setInternalArgType in class AbstractAmberExpr