uk.ac.man.cs.rainbow.simulator
Class Register

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.simulator.Register
All Implemented Interfaces:
Serializable

public class Register
extends Object
implements Serializable

Registers for use by Rainbow threads.

See Also:
Serialized Form

Inner Class Summary
static class Register.Data
          Registers can be first class data values.
 
Constructor Summary
Register(String name)
          Create a new register.
 
Method Summary
 Data getContents()
          Read the register.
 String getName()
          Get the name of the register.
 void setContents(Data contents)
          Assign to the register.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Register

public Register(String name)
Create a new register. The register will initially contain the unknown data value. If you want the register to contain a structured data value, then you must initialise it yourself using an instance of the right type of data.
Parameters:
name - The name of the register to create. Names do not need to be globally unique.
See Also:
UnknownData, RASM.MakeRegister, RASM.Load, RASM.Store
Method Detail

getContents

public Data getContents()
Read the register.

getName

public String getName()
Get the name of the register.

setContents

public void setContents(Data contents)
Assign to the register.
Parameters:
contents - The value to assign.

toString

public String toString()
Overrides:
toString in class Object