pascalinterpreter.operators
Class Subtract

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

public class Subtract
extends Arithmetic

Represents a singleton.


Field Summary
private static Subtract instance
          Holds singleton instance
 
Fields inherited from class pascalinterpreter.Operator
OP_REG_VAR_NAME
 
Constructor Summary
private Subtract()
          prevents instantiation
 
Method Summary
protected  double compute(double opL, double opR)
          Metoda oblicza wartosc wyrazenia.
static Subtract 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 Subtract instance
Holds singleton instance

Constructor Detail

Subtract

private Subtract()
prevents instantiation

Method Detail

getInstance

public static Subtract 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.