Jode 1.90-CVS
Build Aug 6, 2004

net.sf.jode.type
Class NullType

java.lang.Object
  extended bynet.sf.jode.type.Type
      extended bynet.sf.jode.type.ReferenceType
          extended bynet.sf.jode.type.NullType

public class NullType
extends ReferenceType

This class represents the NullType. The null type is special as it may only occur as top type in a range type. It represents the type of the null constant, which may be casted to any object.
Question: Should we replace tUObject = tRange(tObject, tNull) by tNull? Question2: if not, should null have type tNull?

Author:
Jochen Hoenicke

Field Summary
 
Fields inherited from class net.sf.jode.type.Type
EMPTY_IFACES, tBoolByte, tBoolean, tBoolInt, tBoolUInt, tByte, TC_ARRAY, TC_BOOLEAN, TC_BYTE, TC_CHAR, TC_CLASS, TC_CLASSIFACE, TC_DOUBLE, TC_ERROR, TC_FLOAT, TC_INT, TC_INTEGER, TC_LONG, TC_METHOD, TC_NULL, TC_RANGE, TC_SHORT, TC_SYSCLASS, TC_UNKNOWN, TC_VOID, tChar, tCloneable, tComparable, tDouble, tError, tFloat, tInt, tJavaLangClass, tLong, tNull, tObject, tSerializable, tShort, tString, tStringBuffer, tStringBuilder, tUInt, tUnknown, tUObject, tVoid
 
Constructor Summary
NullType()
           
 
Method Summary
 Type createRangeType(ReferenceType bottomType)
          Creates a range type set of this and bottom.
 Type findCommonClassTypes(java.util.Stack otherTypes)
           
 Type getGeneralizedType(Type type)
          Returns the generalized type of this and type.
 Type getSpecializedType(Type type)
          Returns the specialized type of this and type.
 Type getSubType()
          The sub types of this type.
 java.lang.String toString()
          Returns a string representation describing this type set.
 
Methods inherited from class net.sf.jode.type.ReferenceType
getSuperType, implementsAllIfaces, intersection
 
Methods inherited from class net.sf.jode.type.Type
getCanonic, getCastHelper, getDefaultName, getDefaultValue, getHint, getTypeClass, getTypeCode, getTypeSignature, isClassType, isOfType, isSubTypeOf, isValidType, maybeSubTypeOf, stackSize, tArray, tClass, tClass, tMethod, tRange, tSubType, tSuperType, tSystemClass, tType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullType

public NullType()
Method Detail

getSubType

public Type getSubType()
Description copied from class: Type
The sub types of this type.

Specified by:
getSubType in class ReferenceType

createRangeType

public Type createRangeType(ReferenceType bottomType)
Description copied from class: ReferenceType
Creates a range type set of this and bottom. The resulting type set contains all types, that extend all types in bottom and are extended by at least one type in this.
Note that a RangeType will do this, but we normalize the bottom and top set.

Specified by:
createRangeType in class ReferenceType
Parameters:
bottomType - the bottom type.
Returns:
the range type set.

getGeneralizedType

public Type getGeneralizedType(Type type)
Returns the generalized type of this and type. We have two classes and multiple interfaces. The result should be the object that is the the super class of both objects and all interfaces, that one class or interface of each type implements.

Specified by:
getGeneralizedType in class ReferenceType
Parameters:
type - the other type.
Returns:
the generalized type

getSpecializedType

public Type getSpecializedType(Type type)
Returns the specialized type of this and type. We have two classes and multiple interfaces. The result should be the object that extends both objects and the union of all interfaces.

Specified by:
getSpecializedType in class ReferenceType
Parameters:
type - the other type.
Returns:
the specialized type.

toString

public java.lang.String toString()
Description copied from class: Type
Returns a string representation describing this type set.

Overrides:
toString in class Type
Returns:
a string representation describing this type set.

findCommonClassTypes

public Type findCommonClassTypes(java.util.Stack otherTypes)
Overrides:
findCommonClassTypes in class ReferenceType

Jode 1.90-CVS
Build Aug 6, 2004

Copyright © 1998-2004 by Jochen Hoenicke.