harpoon.Temp
Class Label

java.lang.Object
  extended by harpoon.Temp.Label

public class Label
extends Object

A Label represents a (symbolic) address in assembly language.

Version:
$Id: Label.java,v 1.4 2002/02/25 21:07:05 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Field Summary
 String name
           
 
Constructor Summary
Label()
          Makes a new label with an arbitrary name.
Label(String n)
          Makes a new label that prints as "name".
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 String toString()
          a printable representation of the label, for use in assembly language output.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final String name
Constructor Detail

Label

public Label(String n)
Makes a new label that prints as "name". Repeated calls to new Label(s) with the same name s will return labels which are equal to each other according to the equals() method, but not reference equivalent.


Label

public Label()
Makes a new label with an arbitrary name.

Method Detail

toString

public String toString()
a printable representation of the label, for use in assembly language output. Note that the returned String consists only of a name; any platform specific modifiers (such as a colon) need to be appended by the code calling toString().

Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object