nl.bluering
Class Operator

java.lang.Object
  |
  +--nl.bluering.Operator

public class Operator
extends java.lang.Object


Field Summary
static int IN
          the possible values of place
 int level
          the level of this Operator.
 int place
          the place of the Operator: pre,post, or infix.
static int POST
          the possible values of place
static int PRE
          the possible values of place
 
Method Summary
static boolean aoverb(Operator a, Operator b)
           
static boolean aunderb(Operator a, Operator b)
           
static Operator factory(java.lang.String n, java.lang.String type, int level, java.lang.String fname)
          this is the method to construct Operators.
 boolean fitsunder(int l)
          returns whether this Operator can be fitted under the given level.
 int leftlevel()
          returns the level that subexpression on the left must be smaller or equal to.
 int rightlevel()
          returns the level that subexpression on the right must be smaller or equal to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

place

public int place
the place of the Operator: pre,post, or infix.

level

public int level
the level of this Operator. Please do not set it, only read it.

PRE

public static int PRE
the possible values of place

IN

public static int IN
the possible values of place

POST

public static int POST
the possible values of place
Method Detail

aunderb

public static boolean aunderb(Operator a,
                              Operator b)

aoverb

public static boolean aoverb(Operator a,
                             Operator b)

fitsunder

public boolean fitsunder(int l)
returns whether this Operator can be fitted under the given level.

leftlevel

public int leftlevel()
returns the level that subexpression on the left must be smaller or equal to.

rightlevel

public int rightlevel()
returns the level that subexpression on the right must be smaller or equal to.

factory

public static Operator factory(java.lang.String n,
                               java.lang.String type,
                               int level,
                               java.lang.String fname)
this is the method to construct Operators.
Parameters:
n - the appearance of the Operator, for instance "+"
type - any of fx,fy(prefix Operator), xfy,yfx,xfx (infix Operator) or xf,yf (postfix Operator). An x indicates the the subargument at that side must have a strictly lower level than this, an y indicates it must have a lower or equal level. yfy is forbidden because it would lead to ambiguity.
level - the level of this Operator. Must be between 0 and 1200.