|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectharpoon.Backend.RuntimeTiny.PreOrderClazNumbering
public class PreOrderClazNumbering
PreOrderClazNumbering will number single-inheritance
instantiated classes (i.e. not interfaces or arrays of interfaces)
such that all classes numbered in an interval [a,b] will be
instances of the first common superclass of A and B, where
clazNumber(A)==a and clazNumber(B)==b.
This is useful for implementing quick 'instanceOf' tests;
to determine if an object is an instanceof class A, you can
simply see if the object falls within the interval
[classNumber(A),maxChildNumber(A)].
| Constructor Summary | |
|---|---|
PreOrderClazNumbering(ClassHierarchy ch)
Creates a PreOrderClazNumbering. |
|
| Method Summary | |
|---|---|
int |
clazNumber(HClass hc)
Returns the number associated with the given HClass. |
int |
maxChildNumber(HClass hc)
Returns the maximum number associated with an instantiatable child of the given HClass. |
int |
maxNumber()
Returns the largest number which this ClazNumbering
will associate with any HClass. |
int |
minNumber()
Returns the smallest number which this ClazNumbering
will associate with any HClass. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PreOrderClazNumbering(ClassHierarchy ch)
PreOrderClazNumbering.
| Method Detail |
|---|
public int clazNumber(HClass hc)
HClass.
public int maxChildNumber(HClass hc)
HClass.
public int minNumber()
ClazNumbering
will associate with any HClass.
public int maxNumber()
ClazNumbering
will associate with any HClass.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||