hussam.math.operations
Interface Operator

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable<Operator>, Operation, java.io.Serializable
All Known Implementing Classes:
CustomFunctionFactory.CustomFunction, DynamicFunctionFactory.DynamicFunction, Function, Operand, OperatorFactoryDB.CommaOperand

public interface Operator
extends Operation, java.lang.Comparable<Operator>

This interface reflects operators such as Operands(+, -, ^ , * ...etc) and Functions such as Abs, Log, Min, Max...etc an Operator takes an Operation for example from which it will get a new Result. For example: The + operand, will take 2 operations as arguments, it will then computes the addition.

The flags bellow are for parssing purposes.
 They will be used to indicate weather it is the right momment to parse a given argument.
 For example,
 4 +6 * 8
The parser will parse multiplication Operands first becasue they have more power. Then the plus operand will be computed. You can Notice that a Function is computed before any other operators. The Power operand is computed before Multiplication operands. I guess the description below show everything!


Field Summary
static intCOMMA
          Comma has lower power.
static intFUNCTION
          a Function power is the most.
static intINDEFINITE
          a flag Indicating that the Operator has an Indefinite power.
static intLOGICAL
          Logical has low power.
static intMULTIPLY
          Multiplicity is computed before than PLUS operations.
static intNOTHING
          No Power at all.
static intPLUS
          Plus indication.
static intPOWER
          a POWER is stronger than Mulitiplicity operations.
 
Method Summary
 java.lang.StringgetName()
          Returns the name of this Operator.
 intgetType()
           
 
Methods inherited from interface hussam.math.operations.Operation
clone, optimize, result
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

FUNCTION

static final int FUNCTION
a Function power is the most.

See Also:
Constant Field Values

POWER

static final int POWER
a POWER is stronger than Mulitiplicity operations.

See Also:
Constant Field Values

MULTIPLY

static final int MULTIPLY
Multiplicity is computed before than PLUS operations.

See Also:
Constant Field Values

PLUS

static final int PLUS
Plus indication.

See Also:
Constant Field Values

LOGICAL

static final int LOGICAL
Logical has low power.

See Also:
Constant Field Values

COMMA

static final int COMMA
Comma has lower power.

See Also:
Constant Field Values

NOTHING

static final int NOTHING
No Power at all.

See Also:
Constant Field Values

INDEFINITE

static final int INDEFINITE
a flag Indicating that the Operator has an Indefinite power.

See Also:
Constant Field Values
Method Detail

getType

int getType()

getName

java.lang.String getName()
Returns the name of this Operator.

Returns:
the name of this operator.