fi.hu.cs.titokone
Class MemoryLine

java.lang.Object
  extended byfi.hu.cs.titokone.MemoryLine

public class MemoryLine
extends java.lang.Object

This class represents one slot in the TTK-91 computer's memory. It contains both the integer value stored in the memory as well as its symbolic code representation. As such, the class is not strictly to be used in a computer's memory, but can also bridge the gap between applications' binary and symbolic form.


Field Summary
private  int binary
          This field contains the binary form of the data stored in this line.
private  java.lang.String symbolic
          This field contains the symbolic form of the command.
 
Constructor Summary
MemoryLine(int binary, java.lang.String symbolicCommand)
          Creates a memory line with symbolic information.
 
Method Summary
 int getBinary()
          Returns the value of this memory slot.
 java.lang.String getSymbolic()
          Returns the symbolic representation of the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

symbolic

private java.lang.String symbolic
This field contains the symbolic form of the command. It is empty if there is no symbolic representation for the binary.


binary

private int binary
This field contains the binary form of the data stored in this line. It may be a valid command, or just a random number.

Constructor Detail

MemoryLine

public MemoryLine(int binary,
                  java.lang.String symbolicCommand)
Creates a memory line with symbolic information.

Parameters:
binary - Value of this memory slot.
symbolicCommand - String that contains the corresponding symbolic command, or an empty string ("") if there is no representation.
Method Detail

getSymbolic

public java.lang.String getSymbolic()
Returns the symbolic representation of the command. If the command has no symbolic representation, an empty string is returned.

Returns:
Symbolic presentation of command. If symbolic representation of the command is not defined, an empty string is returned.

getBinary

public int getBinary()
Returns the value of this memory slot.

Returns:
Integer value of this memory slot.