soot
Class RefType

java.lang.Object
  |
  +--soot.Type
        |
        +--soot.BaseType
              |
              +--soot.RefType
All Implemented Interfaces:
java.lang.Comparable, RefLikeType, java.io.Serializable, Switchable, ToBriefString

public class RefType
extends BaseType
implements ToBriefString, java.lang.Comparable, RefLikeType

A class that models Java's reference types. RefTypes are parametrized by a class name. Two RefType are equal iff they are parametrized by the same class name as a String.

See Also:
Serialized Form

Field Summary
 java.lang.String className
          the class name that parametrizes this RefType
 
Fields inherited from class soot.Type
typeNum
 
Method Summary
 void apply(Switch sw)
          Method required for use of Switchable.
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object t)
          2 RefTypes are considered equal if they are parametrized by the same class name String.
 Type getArrayElementType()
           
 SootClass getSootClass()
          Get the SootClass object corresponding to this RefType.
 int hashCode()
           
 Type merge(Type other, Scene cm)
          Returns the least common superclass of this type and other.
 java.lang.String toBriefString()
          Returns a brief description of this object.
 java.lang.String toString()
          Returns a textual representation of this type.
 java.lang.String toVeryBriefString()
           
static RefType v()
          Get the default RefType.
static RefType v(SootClass c)
          Create a RefType for a class.
static RefType v(java.lang.String className)
          Create a RefType for a class.
 
Methods inherited from class soot.Type
toMachineType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

className

public final java.lang.String className
the class name that parametrizes this RefType

Method Detail

v

public static RefType v(java.lang.String className)
Create a RefType for a class.

Parameters:
className - The name of the class used to parametrize the created RefType.
Returns:
a RefType for the given class name.

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Specified by:
compareTo in interface java.lang.Comparable
java.lang.ClassCastException

v

public static RefType v(SootClass c)
Create a RefType for a class.

Parameters:
c - A SootClass for which to create a RefType.
Returns:
a RefType for the given SootClass..

v

public static RefType v()
Get the default RefType. It is parametrized by an empty class name string.Implemented as a singleton.

Returns:
a default RefType

getSootClass

public SootClass getSootClass()
Get the SootClass object corresponding to this RefType.

Returns:
the corresponding SootClass

equals

public boolean equals(java.lang.Object t)
2 RefTypes are considered equal if they are parametrized by the same class name String.

Overrides:
equals in class java.lang.Object
Parameters:
t - an object to test for equality.

toString

public java.lang.String toString()
Description copied from class: Type
Returns a textual representation of this type.

Specified by:
toString in class BaseType
Returns:
the base type's name as a string

toBriefString

public java.lang.String toBriefString()
Description copied from interface: ToBriefString
Returns a brief description of this object.

Specified by:
toBriefString in interface ToBriefString
Overrides:
toBriefString in class Type

toVeryBriefString

public java.lang.String toVeryBriefString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

apply

public void apply(Switch sw)
Description copied from class: Type
Method required for use of Switchable.

Specified by:
apply in interface Switchable
Overrides:
apply in class Type

merge

public Type merge(Type other,
                  Scene cm)
Returns the least common superclass of this type and other.

Overrides:
merge in class Type

getArrayElementType

public Type getArrayElementType()
Specified by:
getArrayElementType in interface RefLikeType