Spreadsheet Toolkit

corpus.excel
Class Operator

java.lang.Object
  |
  +--corpus.excel.Component
        |
        +--corpus.excel.FormulaComponent
              |
              +--corpus.excel.Operator
All Implemented Interfaces:
java.io.Serializable

public class Operator
extends FormulaComponent

Used to store the internal representation of a Operator. An operator combines terms and produces a result. In Excel, there are many predefined operators that support both mathematical and logical operations. When you combine several operators into a single formula, Microsoft Excel performs the operations in the following order:

See Also:
Serialized Form

Field Summary
static int CARET
           
static int COMPARISON
           
static int CONCATIONATION
           
static int DIVIDE
           
static int EXPONENT
           
static int MINUS
           
static int MODULO
           
static int PLUS
           
static int TIMES
           
 int type
           
 
Fields inherited from class corpus.excel.FormulaComponent
formula
 
Fields inherited from class corpus.excel.Component
haltOnErrors
 
Constructor Summary
Operator(java.lang.String operator)
           
 
Method Summary
 int getType()
          returns the type of this operator
static Operator highestPrecedence(java.util.Vector operators)
          Works through the input vector and returns the first highest precedent operator found.
 boolean ifUnaryOperator()
          A unary operator is an operator that requires only one term.
 boolean isBinaryOperator()
          A binary operator is an operator that requires two terms.
 boolean isNegative()
           
 int length()
           
static void main(java.lang.String[] args)
           
 void setNegative()
           
 void setSubtraction()
           
 java.lang.String toHTMLString()
          Converts information about this component into an HTML formatted String.
 java.lang.String toString()
          Converts information about this component into a String.
 
Methods inherited from class corpus.excel.FormulaComponent
getReferingFormula, parseTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUS

public static final int PLUS
See Also:
Constant Field Values

MINUS

public static final int MINUS
See Also:
Constant Field Values

TIMES

public static final int TIMES
See Also:
Constant Field Values

DIVIDE

public static final int DIVIDE
See Also:
Constant Field Values

MODULO

public static final int MODULO
See Also:
Constant Field Values

EXPONENT

public static final int EXPONENT
See Also:
Constant Field Values

COMPARISON

public static final int COMPARISON
See Also:
Constant Field Values

CONCATIONATION

public static final int CONCATIONATION
See Also:
Constant Field Values

CARET

public static final int CARET
See Also:
Constant Field Values

type

public int type
Constructor Detail

Operator

public Operator(java.lang.String operator)
Method Detail

setNegative

public void setNegative()

setSubtraction

public void setSubtraction()

isNegative

public boolean isNegative()

getType

public int getType()
returns the type of this operator


isBinaryOperator

public boolean isBinaryOperator()
A binary operator is an operator that requires two terms. Examples include +, -, *, /, %.


ifUnaryOperator

public boolean ifUnaryOperator()
A unary operator is an operator that requires only one term. Examples include ++, the increment operator, --, the decrement operator and !, logical negator.


toString

public java.lang.String toString()
Description copied from class: Component
Converts information about this component into a String.

Specified by:
toString in class Component

toHTMLString

public java.lang.String toHTMLString()
Converts information about this component into an HTML formatted String.

Specified by:
toHTMLString in class Component

highestPrecedence

public static Operator highestPrecedence(java.util.Vector operators)
Works through the input vector and returns the first highest precedent operator found.


length

public int length()

main

public static void main(java.lang.String[] args)
                 throws gnu.regexp.REException
gnu.regexp.REException

Spreadsheet Toolkit

Project Home Page