Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Package Attributes | Static Package Attributes
rene.zirkel.expression.CompareExpression Class Reference

Diverse Vegleiche. More...

Inheritance diagram for rene.zirkel.expression.CompareExpression:
Inheritance graph
[legend]
Collaboration diagram for rene.zirkel.expression.CompareExpression:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CompareExpression (BasicExpression e1, BasicExpression e2, int op)
double getValue () throws ConstructionException
double logical (boolean flag)
void translate ()
String toString ()
void reset ()
boolean isLogical ()
boolean isNumber ()

Static Public Member Functions

static BasicExpression scan (ExpressionText t) throws ConstructionException
static BasicExpression scan (ExpressionText t, int sign) throws ConstructionException
static BasicExpression scanBracket (ExpressionText t) throws ConstructionException

Package Attributes

BasicExpression E1
BasicExpression E2
int Operator
BasicExpression E

Static Package Attributes

static final int LESS = 1
static final int LESSEQUAL = 2
static final int GREATER = 3
static final int GREATEREQUAL = 4
static final int EQUAL = 5
static final int ABOUTEQUAL = 6
static final int MINUS = -1
static final int PLUS = 1

Detailed Description

Diverse Vegleiche.

Definition at line 1557 of file Expression.java.


Constructor & Destructor Documentation

Definition at line 1563 of file Expression.java.

       {      E1=e1; E2=e2; Operator=op;
       }

Here is the caller graph for this function:


Member Function Documentation

Reimplemented from rene.zirkel.expression.BasicExpression.

Definition at line 1603 of file Expression.java.

       {      switch (Operator)
              {      case LESS :
                            return logical(E1.getValue()<E2.getValue());
                     case LESSEQUAL :
                            return logical(E1.getValue()<=E2.getValue());
                     case GREATER :
                            return logical(E1.getValue()>E2.getValue());
                     case GREATEREQUAL :
                            return logical(E1.getValue()>=E2.getValue());
                     case EQUAL :
                            return logical(E1.getValue()==E2.getValue());
                     case ABOUTEQUAL :
                            return logical(
                                   Math.abs(E1.getValue()-E2.getValue())<1e-10);
              }
              return 0.0;
       }

Here is the call graph for this function:

Reimplemented from rene.zirkel.expression.BasicExpression.

Definition at line 1648 of file Expression.java.

       {      return true;
       }

Reimplemented in rene.zirkel.expression.MinusExpression, rene.zirkel.expression.ElementaryExpression, rene.zirkel.expression.BracketExpression, and rene.zirkel.expression.DoubleExpression.

Definition at line 135 of file Expression.java.

       {      return false;
       }

Here is the caller graph for this function:

Definition at line 1623 of file Expression.java.

       {      if (flag) return 1.0;
              else return 0.0;
       }

Here is the caller graph for this function:

Reimplemented from rene.zirkel.expression.BasicExpression.

Definition at line 1644 of file Expression.java.

       {      E1.reset(); E2.reset();
       }

Here is the call graph for this function:

static BasicExpression rene.zirkel.expression.BasicExpression.scan ( ExpressionText  t,
int  sign 
) throws ConstructionException [inline, static, inherited]

Definition at line 107 of file Expression.java.

       {      if (sign==MINUS)
              {      if (t.next()=='(') return new MinusExpression(scanBracket(t));
                     return new MinusExpression(ElementaryExpression.scan(t));
              }
              if (t.next()=='(') return scanBracket(t);
              return ElementaryExpression.scan(t);
       }

Here is the call graph for this function:

Reimplemented from rene.zirkel.expression.BasicExpression.

Definition at line 1567 of file Expression.java.

       {      BasicExpression E1=SumExpression.scan(t);
              char c=t.next();
              int op=0;
              if (c=='<')
              {      t.advance();
                     if (t.next(true)=='=')
                     {      op=LESSEQUAL;
                            t.advance();
                     }
                     else op=LESS;
              }
              else if (c=='>')
              {      t.advance();
                     if (t.next(true)=='=')
                     {      op=GREATEREQUAL;
                            t.advance();
                     }
                     else op=GREATER;
              }
              else if (c=='=')
              {      t.advance();
                     if (t.next(true)=='=') t.advance();
                     op=EQUAL;
              }
              else if (c=='~')
              {      t.advance();
                     if (t.next(true)=='=') t.advance();
                     op=ABOUTEQUAL;
              }
              else return E1;
              BasicExpression E2=SumExpression.scan(t);
              return new CompareExpression(E1,E2,op);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 118 of file Expression.java.

       {      t.advance();
              BasicExpression E=TopExpression.scan(t);
              if (t.next()==')') t.advance();
              else
                     throw new ConstructionException(Zirkel.name("exception.bracket"));
              return E;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1632 of file Expression.java.

       {      switch (Operator)
              {      case LESS : return E1+"<"+E2;
                     case LESSEQUAL : return E1+"<="+E2;
                     case GREATER : return E1+">"+E2;
                     case GREATEREQUAL : return E1+">="+E2;
                     case EQUAL : return E1+"=="+E2;
                     case ABOUTEQUAL : return E1+"~="+E2;
              }
              return "";
       }

Reimplemented from rene.zirkel.expression.BasicExpression.

Definition at line 1628 of file Expression.java.

       {      E1.translate(); E2.translate();
       }

Here is the call graph for this function:


Member Data Documentation

final int rene.zirkel.expression.CompareExpression.ABOUTEQUAL = 6 [static, package]

Definition at line 1561 of file Expression.java.

Definition at line 1558 of file Expression.java.

Definition at line 1558 of file Expression.java.

final int rene.zirkel.expression.CompareExpression.EQUAL = 5 [static, package]

Definition at line 1561 of file Expression.java.

final int rene.zirkel.expression.CompareExpression.GREATER = 3 [static, package]

Definition at line 1560 of file Expression.java.

Definition at line 1560 of file Expression.java.

final int rene.zirkel.expression.CompareExpression.LESS = 1 [static, package]

Definition at line 1560 of file Expression.java.

final int rene.zirkel.expression.CompareExpression.LESSEQUAL = 2 [static, package]

Definition at line 1560 of file Expression.java.

final int rene.zirkel.expression.BasicExpression.MINUS = -1 [static, package, inherited]

Definition at line 91 of file Expression.java.

Definition at line 1559 of file Expression.java.

final int rene.zirkel.expression.BasicExpression.PLUS = 1 [static, package, inherited]

Definition at line 91 of file Expression.java.


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