pascalinterpreter.operators
Class New

java.lang.Object
  extended bypascalinterpreter.Operator
      extended bypascalinterpreter.UnaryOperator
          extended bypascalinterpreter.operators.Memory
              extended bypascalinterpreter.operators.New

public class New
extends Memory

Represents a singleton.


Field Summary
private static New instance
          Holds singleton instance
 
Fields inherited from class pascalinterpreter.Operator
OP_REG_VAR_NAME
 
Constructor Summary
private New()
          prevents instantiation
 
Method Summary
 void execute(Variable operand)
          Metoda wykonuje operację na operandzie.
static New getInstance()
          Returns the singleton instance.
 
Methods inherited from class pascalinterpreter.operators.Memory
isEmpty, isPossible
 
Methods inherited from class pascalinterpreter.UnaryOperator
execInitialize
 
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 New instance
Holds singleton instance

Constructor Detail

New

private New()
prevents instantiation

Method Detail

getInstance

public static New getInstance()
Returns the singleton instance.

Returns:
the singleton instance

execute

public void execute(Variable operand)
             throws InternalException,
                    RuntimeException
Description copied from class: UnaryOperator
Metoda wykonuje operację na operandzie.

Specified by:
execute in class UnaryOperator
Parameters:
operand - - zmienna, na której ma zostać wykonana operacja.
Throws:
RuntimeException - - Może wystąpić jeżeli w programie użytkownika występują niedozwolone operacje.
InternalException - - Może wystąpić tylko podczas niepoprawnej pracy interpretera.