harpoon.Interpret.Tree
Class StringPointer

java.lang.Object
  extended by harpoon.Util.Tuple
      extended by harpoon.Interpret.Tree.StringPointer
All Implemented Interfaces:
Serializable, Comparable

public class StringPointer
extends Tuple

The StringPointer class represents a pointer to an string constant. This pointer can be dereferenced with getValue().

Version:
$Id: StringPointer.java,v 1.2 2002/02/25 21:06:01 cananian Exp $
Author:
Duncan Bryce <duncan@lcs.mit.edu>
See Also:
Serialized Form

Field Summary
static int ARRAY_PTR
           
static int CLAZ_PTR
           
static int CONST_PTR
           
static int FIELD_PTR
           
static int IFACE_PTR
           
static int STRING_PTR
           
static int UNDEF_PTR
           
 
Method Summary
 harpoon.Interpret.Tree.Pointer add(long offset)
          Throws an error, as StringPointers are constant.
 boolean equals(Object obj)
          Returns true if obj is a StringPointer that points to the same location as this StringPointer.
 Object getBase()
          Returns a Label representing the base of this StringPointer
 long getOffset()
          Returns the offset of this StringPointer.
 Object getValue()
          Returns the value obtained by dereferencing this StringPointer.
 boolean isConst()
          Always returns true.
 boolean isDerived()
          Always returns false.
 int kind()
          Returns an integer enumeration of the kind of this Pointer.
 String toString()
          Returns a human-readable description of this Tuple.
 void updateValue(Object value)
          Throws an error, as StringPointers are constant.
 
Methods inherited from class harpoon.Util.Tuple
asList, compareTo, hashCode, proj
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ARRAY_PTR

public static final int ARRAY_PTR
See Also:
Constant Field Values

CLAZ_PTR

public static final int CLAZ_PTR
See Also:
Constant Field Values

CONST_PTR

public static final int CONST_PTR
See Also:
Constant Field Values

FIELD_PTR

public static final int FIELD_PTR
See Also:
Constant Field Values

IFACE_PTR

public static final int IFACE_PTR
See Also:
Constant Field Values

STRING_PTR

public static final int STRING_PTR
See Also:
Constant Field Values

UNDEF_PTR

public static final int UNDEF_PTR
See Also:
Constant Field Values
Method Detail

add

public harpoon.Interpret.Tree.Pointer add(long offset)
Throws an error, as StringPointers are constant.


equals

public boolean equals(Object obj)
Returns true if obj is a StringPointer that points to the same location as this StringPointer.

Overrides:
equals in class Tuple

getBase

public Object getBase()
Returns a Label representing the base of this StringPointer


getOffset

public long getOffset()
Returns the offset of this StringPointer.


getValue

public Object getValue()
Returns the value obtained by dereferencing this StringPointer. This value is in non-native format.


isConst

public boolean isConst()
Always returns true.


isDerived

public boolean isDerived()
Always returns false.


kind

public int kind()
Returns an integer enumeration of the kind of this Pointer. The enumerated values are public fields of the Pointer class.


updateValue

public void updateValue(Object value)
Throws an error, as StringPointers are constant.


toString

public String toString()
Description copied from class: Tuple
Returns a human-readable description of this Tuple.

Overrides:
toString in class Tuple