Back to index

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

double = 34.45879 double = +34.45879 double = -34.45879 More...

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

List of all members.

Public Member Functions

 DoubleExpression (double x)
double getValue () throws ConstructionException
String toString ()
void translate ()
boolean isNumber ()
void reset ()
boolean isLogical ()

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

double X
BasicExpression E

Static Package Attributes

static final int MINUS = -1
static final int PLUS = 1

Detailed Description

double = 34.45879 double = +34.45879 double = -34.45879

Definition at line 154 of file Expression.java.


Constructor & Destructor Documentation

Definition at line 157 of file Expression.java.

       {      X=x;
       }

Here is the caller graph for this function:


Member Function Documentation

Reimplemented from rene.zirkel.expression.BasicExpression.

Definition at line 194 of file Expression.java.

       {      return X;
       }

Reimplemented in rene.zirkel.expression.OrExpression, rene.zirkel.expression.AndExpression, rene.zirkel.expression.NotExpression, and rene.zirkel.expression.CompareExpression.

Definition at line 143 of file Expression.java.

       {      return false;
       }

Here is the caller graph for this function:

Reimplemented from rene.zirkel.expression.BasicExpression.

Definition at line 207 of file Expression.java.

       {      return true;
       }
void rene.zirkel.expression.BasicExpression.reset ( ) [inline, inherited]
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 161 of file Expression.java.

       {      double result=0;
              double Faktor=1;
              boolean Punkt=false,Digit=false;
              boolean Negative=false;
              if (t.next()=='+') t.advance();
              else if (t.next()=='-')
              {      Negative=true;
                     t.advance();
              }
              while (true) 
              {      char c=t.next();
                     if (c>='0' && c<='9')
                     {      result=result*10+(c-'0');
                            if (Punkt) Faktor=Faktor/10;
                            t.advance();
                            Digit=true;
                     }
                     else if (c=='.')
                     {      if (Punkt)
                                   throw new ConstructionException(Zirkel.name("exception.dot"));
                            Punkt=true;
                            t.advance();
                     }
                     else break;
              }
              if (!Digit)
                     throw new ConstructionException(Zirkel.name("exception.nodigit"));
              if (Negative) result=-result;
              return new DoubleExpression(Faktor*result);
       }

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 198 of file Expression.java.

       {      String s=""+X;
              if (s.endsWith(".0")) s=s.substring(0,s.length()-2);
              return s;
       }

Reimplemented from rene.zirkel.expression.BasicExpression.

Definition at line 204 of file Expression.java.

       {}

Member Data Documentation

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

Definition at line 91 of file Expression.java.

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

Definition at line 91 of file Expression.java.

Definition at line 155 of file Expression.java.


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