All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.Temp.Temp

java.lang.Object
   |
   +----harpoon.Temp.Temp

public class Temp
extends Object
The Temp class represents a temporary variable. This class maintains static state to allow us to allocate guaranteed-unique names for our temps.

Version:
$Id: Temp.java,v 1.14 1998/11/10 00:47:41 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
TypeMap, ConstMap, TempList

Constructor Index

 o Temp()
Creates a unique temporary variable, using default prefix ("t").
 o Temp(String)
Creates a unique temporary with a suggested name.
 o Temp(Temp)
Creates a new temp based on the name of an existing temp.

Method Index

 o hashCode()
Returns a hashcode for this temporary.
 o name()
Returns the name of this temporary
 o toString()
Returns a string representation of this temporary.

Constructors

 o Temp
 public Temp()
Creates a unique temporary variable, using default prefix ("t").

 o Temp
 public Temp(String m_prefix)
Creates a unique temporary with a suggested name. Trailing underscores will be stripped from the suggested name, and a digit string will be appended to make the name unique.

Parameters:
m_prefix - the name prefix. m_prefix may not be null.
 o Temp
 public Temp(Temp t)
Creates a new temp based on the name of an existing temp.

Methods

 o name
 public String name()
Returns the name of this temporary

 o toString
 public String toString()
Returns a string representation of this temporary.

Overrides:
toString in class Object
 o hashCode
 public int hashCode()
Returns a hashcode for this temporary. The hashcode is the same as the hashcode of the hashcode's name.

Overrides:
hashCode in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index