harpoon.Interpret.Tree
Class StringPointer

java.lang.Object
  |
  +--harpoon.Util.Tuple
        |
        +--harpoon.Interpret.Tree.Pointer
              |
              +--harpoon.Interpret.Tree.StringPointer
All Implemented Interfaces:
Comparable, Serializable

public class StringPointer
extends harpoon.Interpret.Tree.Pointer

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.

Specified by:
add in class harpoon.Interpret.Tree.Pointer

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

Specified by:
getBase in class harpoon.Interpret.Tree.Pointer

getOffset

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

Specified by:
getOffset in class harpoon.Interpret.Tree.Pointer

getValue

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

Overrides:
getValue in class harpoon.Interpret.Tree.Pointer

isConst

public boolean isConst()
Always returns true.

Specified by:
isConst in class harpoon.Interpret.Tree.Pointer

isDerived

public boolean isDerived()
Always returns false.

Specified by:
isDerived in class harpoon.Interpret.Tree.Pointer

kind

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

Specified by:
kind in class harpoon.Interpret.Tree.Pointer

updateValue

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

Overrides:
updateValue in class harpoon.Interpret.Tree.Pointer

toString

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

Overrides:
toString in class Tuple