pascalinterpreter.operators
Class AssignRegistry

java.lang.Object
  extended bypascalinterpreter.Operator
      extended bypascalinterpreter.UnaryOperator
          extended bypascalinterpreter.operators.AssignRegistry

public class AssignRegistry
extends UnaryOperator

Represents a singleton.


Field Summary
private static AssignRegistry instance
          Holds singleton instance
 
Fields inherited from class pascalinterpreter.Operator
OP_REG_VAR_NAME
 
Constructor Summary
private AssignRegistry()
          prevents instantiation
 
Method Summary
 void execute(Variable operand)
          Metoda wykonuje operację na operandzie.
static AssignRegistry getInstance()
          Returns the singleton instance.
 boolean isPossible(DataType type)
          Metoda sprawdza, czy operacja jest możliwa na takim typie danych.
 
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 AssignRegistry instance
Holds singleton instance

Constructor Detail

AssignRegistry

private AssignRegistry()
prevents instantiation

Method Detail

getInstance

public static AssignRegistry getInstance()
Returns the singleton instance.

Returns:
the singleton instance

execute

public void execute(Variable operand)
             throws InternalException
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:
InternalException - - Może wystąpić tylko podczas niepoprawnej pracy interpretera.

isPossible

public boolean isPossible(DataType type)
Description copied from class: UnaryOperator
Metoda sprawdza, czy operacja jest możliwa na takim typie danych.

Specified by:
isPossible in class UnaryOperator
Parameters:
type - - sprawdzany typ danych.
Returns:
True, jeżeli operator operuje na typie przekazanym w parametrze. Jeżeli nie, to false.