pascalinterpreter.operators
Class Divide

java.lang.Object
  extended bypascalinterpreter.Operator
      extended bypascalinterpreter.BinaryOperator
          extended bypascalinterpreter.operators.Arithmetic
              extended bypascalinterpreter.operators.Divide

public class Divide
extends Arithmetic

Represents a singleton.


Field Summary
private static Divide instance
          Holds singleton instance
 
Fields inherited from class pascalinterpreter.Operator
OP_REG_VAR_NAME
 
Constructor Summary
private Divide()
          prevents instantiation
 
Method Summary
protected  double compute(double opL, double opR)
          Metoda oblicza wartosc wyrazenia.
static Divide getInstance()
          Returns the singleton instance.
 
Methods inherited from class pascalinterpreter.operators.Arithmetic
execute
 
Methods inherited from class pascalinterpreter.BinaryOperator
execInitialize, isPossible, makeConversion, parseDouble
 
Methods inherited from class pascalinterpreter.Operator
getRegistry, setRegistry, setRegistry, setRegistry, setRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static Divide instance
Holds singleton instance

Constructor Detail

Divide

private Divide()
prevents instantiation

Method Detail

getInstance

public static Divide getInstance()
Returns the singleton instance.

Returns:
the singleton instance

compute

protected double compute(double opL,
                         double opR)
Description copied from class: Arithmetic
Metoda oblicza wartosc wyrazenia. Wszystkie operacje, z wyjatkiem dodawania wykonywane sa na zmiennych typu double.

Specified by:
compute in class Arithmetic
Parameters:
opL - - lewy operand
opR - - prawy operand
Returns:
Wartość wyrażenia, w postaci liczby double.