Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes
rene.zirkel.expression.Expression Class Reference
Collaboration diagram for rene.zirkel.expression.Expression:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Expression (String s, Construction c, ConstructionObject o, String var[], boolean nocircles)
 Create a new expression.
 Expression (String s, Construction c, ConstructionObject o, String var[])
 Expression (String s, Construction c, ConstructionObject o)
boolean isValid ()
String getErrorText ()
double getValue () throws ConstructionException
void setValue (double x)
String toString ()
DepList getDepList ()
void translate ()
boolean isNumber ()
void reset ()
boolean isForcePlus ()
void setForcePlus (boolean flag)
ConstructionObject getObject ()
void addDep (ConstructionObject o)
 Add the objects this expression depends on to the static dependency list of the current object.

Package Attributes

String S
BasicExpression E
boolean Valid
String ErrorText
DepList DL
double Value
boolean HasDoubleValue = false
boolean ForcePlus = false

Detailed Description

Definition at line 1822 of file Expression.java.


Constructor & Destructor Documentation

rene.zirkel.expression.Expression.Expression ( String  s,
Construction  c,
ConstructionObject  o,
String  var[],
boolean  nocircles 
) [inline]

Create a new expression.

Parameters:
sexpression string
cconstruction to search for objects
o"this" object
varvariable names used in the referring object
nocirclesprevent circular exressions

Definition at line 1840 of file Expression.java.

       {      if (s.startsWith("+"))
              {      ForcePlus=true;
                     s=s.substring(1);
              }
              S=s;
              DL=new DepList();
              try
              {      ExpressionText t=new ExpressionText(s,c,o,DL,nocircles);
                     t.setVar(var);
                     E=TopExpression.scan(t);
                     if (t.next()!=0)
                            throw new ConstructionException(
                                   Zirkel.name("exception.superfluous"));
                     Valid=true;
              }
              catch (Exception e)
              {      Valid=false; 
                     ErrorText=(e.toString());
                     //e.printStackTrace();
              }
       }

Here is the call graph for this function:

rene.zirkel.expression.Expression.Expression ( String  s,
Construction  c,
ConstructionObject  o,
String  var[] 
) [inline]

Definition at line 1864 of file Expression.java.

       {      this(s,c,o,var,false);
       }

Definition at line 1868 of file Expression.java.

       {      this(s,c,o,null,false);
       }

Member Function Documentation

Add the objects this expression depends on to the static dependency list of the current object.

Definition at line 1930 of file Expression.java.

       {      Enumeration e=getDepList().elements();
              while (e.hasMoreElements())
              {      ConstructionObject.DL.add((ConstructionObject)e.nextElement());
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1901 of file Expression.java.

       {      return DL;
       }

Here is the caller graph for this function:

Definition at line 1875 of file Expression.java.

       {      return ErrorText;
       }

Here is the caller graph for this function:

Definition at line 1921 of file Expression.java.

       {      if (E instanceof ObjectExpression) return ((ObjectExpression)E).getObject();
              else return null;
       }

Here is the caller graph for this function:

Definition at line 1878 of file Expression.java.

       {      if (HasDoubleValue) return Value;
              if (!Valid)
                     throw new ConstructionException(Zirkel.name("exception.expression"));
              double x=E.getValue();
              if (Double.isNaN(x) || Double.isInfinite(x))
                     throw new ConstructionException(Zirkel.name("exception.value"));
              return x;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1918 of file Expression.java.

{ return ForcePlus; }

Definition at line 1910 of file Expression.java.

       {      return HasDoubleValue || E.isNumber();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1872 of file Expression.java.

       {      return Valid;
       }

Here is the caller graph for this function:

Definition at line 1914 of file Expression.java.

       {      if (E!=null && Valid) E.reset();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1919 of file Expression.java.

{ ForcePlus=flag; }
void rene.zirkel.expression.Expression.setValue ( double  x) [inline]

Definition at line 1888 of file Expression.java.

       {      HasDoubleValue=true;
              ForcePlus=false;
              DL=new DepList();
              Value=x;
       }

Here is the caller graph for this function:

Definition at line 1895 of file Expression.java.

       {      if (HasDoubleValue) return ""+Value;
              if (Valid) return E.toString();
              else return S;
       }

Definition at line 1905 of file Expression.java.

       {      E.translate();
              DL.translate();
       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1827 of file Expression.java.

Definition at line 1824 of file Expression.java.

Definition at line 1826 of file Expression.java.

Definition at line 1830 of file Expression.java.

Definition at line 1829 of file Expression.java.

Definition at line 1823 of file Expression.java.

Definition at line 1825 of file Expression.java.

Definition at line 1828 of file Expression.java.


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