All Packages Class Hierarchy This Package Previous Next Index
Class edu.gac.max.mcs388.s2001.compiler_support.Register
java.lang.Object
|
+----edu.gac.max.mcs388.s2001.compiler_support.Register
- public class Register
- extends Object
The Register class is used to represent a register of the target
architecture (MIPS). For now it is little more than the
$whatever name of the register, but this class might
well be evolved.
Written 7 Feb 1997 by
Max Hailperin
<max@gac.edu>
-
Register(String)
- The constructor that takes a single String argument expects it to be
the name of the register, without the $.
-
Register(String, int)
- The constructor which takes a prefix String and then an integer is
for members of numbered families of registers, e.g.
-
equals(Object)
- The equals method is overriden such that Registers are equal if their
names are equal
-
hashCode()
- The hashCode method is overriden to reflect the name-based equality.
-
toString()
- The toString conversion (which is automatically invoked if a Regiser
is added to a String) provides the name, inclusive of the $.
Register
public Register(String n)
- The constructor that takes a single String argument expects it to be
the name of the register, without the $.
Register
public Register(String prefix,
int num)
- The constructor which takes a prefix String and then an integer is
for members of numbered families of registers, e.g. one could do
new Register("t", 0)
to create $t0
.
toString
public String toString()
- The toString conversion (which is automatically invoked if a Regiser
is added to a String) provides the name, inclusive of the $.
- Overrides:
- toString in class Object
equals
public boolean equals(Object other)
- The equals method is overriden such that Registers are equal if their
names are equal
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- The hashCode method is overriden to reflect the name-based equality.
- Overrides:
- hashCode in class Object
All Packages Class Hierarchy This Package Previous Next Index