|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.MetaMethods.GenType
public class GenType
GenType
models a type. Although we can always record
the possible types of a variable as a set of HClass
es,
this is inneficient in most of the cases. GenType
tries
to cope with this by representing both monomorphic types (which
correspond to a single HCode
) and polymorphic types
(which correspond to a set of HClass
es, a type cone
rooted in a specific HClass
)
Field Summary | |
---|---|
static int |
MONO
Monomorphic type. |
static int |
POLY
Polymorphic type. |
Constructor Summary | |
---|---|
GenType(HClass hclass)
Creates a polymorphic type, having hclass as superclass. |
|
GenType(HClass hclass,
int kind)
Creates a GenType . |
Method Summary | |
---|---|
boolean |
equals(Object o)
Checks the equality of this object with object
o . |
HClass |
getHClass()
Returns the underlying HClass . |
int |
hashCode()
Computes the hash code of this object. |
boolean |
included(GenType gt2,
ClassHierarchy ch)
Checks whether this general type is included into the
set of types abstracted by the general type gt2 . |
boolean |
isPOLY()
Checks whether this is a polymorphic type. |
String |
toString()
Pretty printer for debug purposes. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MONO
hclass
into the type space.
public static final int POLY
hclass
and containing hclass
and all its
subtypes (subclasses).
Constructor Detail |
---|
public GenType(HClass hclass, int kind)
GenType
. kind
should be
MONO
or POLY
.
public GenType(HClass hclass)
hclass
as superclass.
Method Detail |
---|
public boolean isPOLY()
public HClass getHClass()
HClass
.
If this
general type represents a monomorphic type,
the result is exactly that type. Otherwise, for polymorphic types,
the result is the root of the type cone.
public boolean equals(Object o)
this
object with object
o
.
equals
in class Object
public int hashCode()
this
object.
hashCode
in class Object
public boolean included(GenType gt2, ClassHierarchy ch)
this
general type is included into the
set of types abstracted by the general type gt2
.
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |