junc.types
Class ClassType

java.lang.Object
  |
  +--junc.types.JUnCBaseType
        |
        +--junc.types.ReferenceType
              |
              +--junc.types.ClassType

public class ClassType
extends ReferenceType


Field Summary
 
Fields inherited from class junc.types.JUnCBaseType
Boolean, BooleanRep, Byte, ByteRep, Char, CharRep, Double, DoubleRep, Error, Exception, Float, FloatRep, Int, IntRep, Long, LongRep, Null, NullRep, RuntimeException, Short, ShortRep, Throwable, Void, VoidRep
 
Constructor Summary
ClassType(java.lang.String name)
           
ClassType(junc.symtab.Symbol name)
           
 
Method Summary
 org.apache.bcel.generic.Instruction APPENDSTB(org.apache.bcel.generic.ConstantPoolGen cpg)
           
 int distanceTo(junc.types.JUnCBaseType other)
           
 junc.symtab.Symbol findField(junc.symtab.Symbol fname)
          Search for a field in this type or in any of its super types (both classes and interfaces).
 junc.types.MethodDescriptor findMethod(junc.types.MethodDescriptor mdesc)
          Search for a method in this type or in any of its super types Returns the closest unique occurrence of a method type, that is most specific, or null if no match was established If the most specific method type is not unique, than we have 2 cases : - if the 2 methods are defined in the same class, than an ambiguous type error is thrown - if the 2 mthods are defined in different classes, than we have 2 sub cases - if the 2 method types are identical, than the one closer to the leaf of the type hierarchy overrides the one higher up - if the 2 method types are not identical, then a ambiguous type error is thrown If a more specific method type is encountered higher up in the type hierarchy, then this also results in an ambiguous type error
 boolean identicalTo(junc.types.JUnCBaseType other)
           
 org.apache.bcel.generic.Instruction IFEQ(boolean tozero)
           
 org.apache.bcel.generic.Instruction IFNE(boolean tozero)
           
 boolean isTopType()
           
 junc.symtab.Symbol name()
           
 boolean subTypeOf(junc.types.JUnCBaseType other)
           
 java.util.Vector superInterfaces()
           
 junc.types.ClassType superType()
           
 boolean superTypeOf(junc.types.JUnCBaseType other)
           
 boolean throwable()
          Determines if this type can be thrown as an exception.
 org.apache.bcel.generic.Type toClassFileType()
          Map an junc type to a ClassGen one.
 java.lang.String toString()
           
 org.apache.bcel.generic.InstructionList VALUEOF(org.apache.bcel.generic.ConstantPoolGen cpg)
           
 
Methods inherited from class junc.types.ReferenceType
ALOAD, ASTORE, DUP, DUPX1, DUPX2, floatingPointType, integralType, LOAD, NEWARRAY, numericType, POP, primitiveType, referenceType, RETURN, STORE
 
Methods inherited from class junc.types.JUnCBaseType
ADD, ADDSTRING, AND, CAST, CMP, createClassType, createClassType, createType, createType, DIV, IFGE, IFGT, IFLE, IFLT, MUL, NEG, oneWord, OR, PUSH, relatedTo, REM, SHL, SHR, SUB, toInternalString, twoWords, USHR, XOR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassType

public ClassType(java.lang.String name)

ClassType

public ClassType(junc.symtab.Symbol name)
Method Detail

name

public junc.symtab.Symbol name()
Overrides:
name in class JUnCBaseType

identicalTo

public boolean identicalTo(junc.types.JUnCBaseType other)
Specified by:
identicalTo in class ReferenceType

isTopType

public boolean isTopType()

superType

public junc.types.ClassType superType()

superInterfaces

public java.util.Vector superInterfaces()

subTypeOf

public boolean subTypeOf(junc.types.JUnCBaseType other)
Specified by:
subTypeOf in class ReferenceType

superTypeOf

public boolean superTypeOf(junc.types.JUnCBaseType other)
Specified by:
superTypeOf in class ReferenceType

distanceTo

public int distanceTo(junc.types.JUnCBaseType other)
Specified by:
distanceTo in class ReferenceType

findField

public junc.symtab.Symbol findField(junc.symtab.Symbol fname)
                             throws AmbiguousName
Search for a field in this type or in any of its super types (both classes and interfaces). Returns a fully qualified name.

AmbiguousName

findMethod

public junc.types.MethodDescriptor findMethod(junc.types.MethodDescriptor mdesc)
                                       throws TypeCheckError
Search for a method in this type or in any of its super types Returns the closest unique occurrence of a method type, that is most specific, or null if no match was established If the most specific method type is not unique, than we have 2 cases : - if the 2 methods are defined in the same class, than an ambiguous type error is thrown - if the 2 mthods are defined in different classes, than we have 2 sub cases - if the 2 method types are identical, than the one closer to the leaf of the type hierarchy overrides the one higher up - if the 2 method types are not identical, then a ambiguous type error is thrown If a more specific method type is encountered higher up in the type hierarchy, then this also results in an ambiguous type error

TypeCheckError

throwable

public boolean throwable()
Description copied from class: JUnCBaseType
Determines if this type can be thrown as an exception. Defaults to false but overridden in ClassType

Overrides:
throwable in class JUnCBaseType

toString

public java.lang.String toString()
Specified by:
toString in class JUnCBaseType

toClassFileType

public org.apache.bcel.generic.Type toClassFileType()
Map an junc type to a ClassGen one.

Specified by:
toClassFileType in class JUnCBaseType

IFEQ

public org.apache.bcel.generic.Instruction IFEQ(boolean tozero)
Overrides:
IFEQ in class JUnCBaseType

IFNE

public org.apache.bcel.generic.Instruction IFNE(boolean tozero)
Overrides:
IFNE in class JUnCBaseType

VALUEOF

public org.apache.bcel.generic.InstructionList VALUEOF(org.apache.bcel.generic.ConstantPoolGen cpg)
Overrides:
VALUEOF in class JUnCBaseType

APPENDSTB

public org.apache.bcel.generic.Instruction APPENDSTB(org.apache.bcel.generic.ConstantPoolGen cpg)
Overrides:
APPENDSTB in class JUnCBaseType