polyglot.ext.jl.types
Class NullType_c

java.lang.Object
  extended by polyglot.ext.jl.types.TypeObject_c
      extended by polyglot.ext.jl.types.Type_c
          extended by polyglot.ext.jl.types.NullType_c
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, NullType, Qualifier, Type, TypeObject, Copy

public class NullType_c
extends Type_c
implements NullType

A NullType represents the type of the Java keyword null.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class polyglot.ext.jl.types.TypeObject_c
position, ts
 
Constructor Summary
protected NullType_c()
          Used for deserializing types.
  NullType_c(TypeSystem ts)
           
 
Method Summary
 boolean descendsFromImpl(Type ancestor)
          Return true if this type descends from ancestor.
 boolean equalsImpl(TypeObject t)
          Default implementation is pointer equality.
 int hashCode()
           
 boolean isCanonical()
          Return true if the type object contains no unknown/ambiguous types.
 boolean isCastValidImpl(Type toType)
          Requires: all type arguments are canonical.
 boolean isImplicitCastValidImpl(Type toType)
          Return true if a value of this type can be assigned to a variable of type toType.
 boolean isNull()
          Return true if a null type.
 NullType toNull()
          Returns a non-null iff isNull() returns true.
 java.lang.String toString()
          Yields a string representing this type.
 java.lang.String translate(Resolver c)
          Return a string into which to translate the type.
 
Methods inherited from class polyglot.ext.jl.types.Type_c
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isClass, isComparable, isDouble, isFloat, isImplicitCastValid, isInt, isIntOrLess, isLong, isLongOrLess, isNumeric, isPackage, isPrimitive, isReference, isShort, isSubtype, isSubtypeImpl, isThrowable, isType, isUncheckedException, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toClass, toPackage, toPrimitive, toReference, toType
 
Methods inherited from class polyglot.ext.jl.types.TypeObject_c
copy, equals, position, typeSystem
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface polyglot.types.Type
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isClass, isComparable, isDouble, isFloat, isImplicitCastValid, isInt, isIntOrLess, isLong, isLongOrLess, isNumeric, isPrimitive, isReference, isShort, isSubtype, isSubtypeImpl, isThrowable, isUncheckedException, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toClass, toPrimitive, toReference
 
Methods inherited from interface polyglot.types.Qualifier
isPackage, isType, toPackage, toType
 
Methods inherited from interface polyglot.types.TypeObject
position, typeSystem
 
Methods inherited from interface polyglot.util.Copy
copy
 

Constructor Detail

NullType_c

protected NullType_c()
Used for deserializing types.


NullType_c

public NullType_c(TypeSystem ts)
Method Detail

translate

public java.lang.String translate(Resolver c)
Description copied from class: Type_c
Return a string into which to translate the type.

Specified by:
translate in interface Type
Specified by:
translate in class Type_c
Parameters:
c - A resolver in which to lookup this type to determine if the type is unique in the given resolver.

toString

public java.lang.String toString()
Description copied from class: Type_c
Yields a string representing this type. The string should be consistent with equality. That is, if this.equals(anotherType), then it should be that this.toString().equals(anotherType.toString()). The string does not have to be a legal Java identifier. It is suggested, but not required, that it be an easily human readable representation, and thus useful in error messages and generated output.

Specified by:
toString in interface Type
Specified by:
toString in class Type_c

equalsImpl

public boolean equalsImpl(TypeObject t)
Description copied from class: TypeObject_c
Default implementation is pointer equality.

Specified by:
equalsImpl in interface TypeObject
Overrides:
equalsImpl in class TypeObject_c
See Also:
TypeObject_c.equalsImpl(TypeObject), Object.hashCode()

hashCode

public int hashCode()
Overrides:
hashCode in class TypeObject_c

isCanonical

public boolean isCanonical()
Description copied from interface: TypeObject
Return true if the type object contains no unknown/ambiguous types.

Specified by:
isCanonical in interface TypeObject
Overrides:
isCanonical in class Type_c

isNull

public boolean isNull()
Description copied from interface: Type
Return true if a null type.

Specified by:
isNull in interface Type
Overrides:
isNull in class Type_c

toNull

public NullType toNull()
Description copied from class: Type_c
Returns a non-null iff isNull() returns true.

Specified by:
toNull in interface Type
Overrides:
toNull in class Type_c

descendsFromImpl

public boolean descendsFromImpl(Type ancestor)
Description copied from class: Type_c
Return true if this type descends from ancestor.

Specified by:
descendsFromImpl in interface Type
Overrides:
descendsFromImpl in class Type_c

isImplicitCastValidImpl

public boolean isImplicitCastValidImpl(Type toType)
Description copied from class: Type_c
Return true if a value of this type can be assigned to a variable of type toType.

Specified by:
isImplicitCastValidImpl in interface Type
Overrides:
isImplicitCastValidImpl in class Type_c

isCastValidImpl

public boolean isCastValidImpl(Type toType)
Requires: all type arguments are canonical. ToType is not a NullType. Returns true iff a cast from this to toType is valid; in other words, some non-null members of this are also members of toType.

Specified by:
isCastValidImpl in interface Type
Overrides:
isCastValidImpl in class Type_c