Class ObjectType
java.lang.Object
org.jfuncmachine.compiler.model.types.ObjectType
- All Implemented Interfaces:
Type
An object type
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringThe class name of the objectfinal booleanTrue if this class represents an enum -
Constructor Summary
ConstructorsConstructorDescriptionCreate an object type for java.lang.ObjectObjectType(Class clazz) Create an object type from the given classObjectType(String className) Create an object type for the given class nameObjectType(String className, boolean representsEnum) Create an object type for the given class name -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the unboxed type of this type, if anyinthashCode()booleanisBoxableFrom(Type desiredType) Tests whether this object type can be a box for the specified typebooleanTest whether this type is a box typebooleanisUnboxableTo(Type desiredType) Tests whether this object type can be unboxed to a specific typetoString()Methods inherited from interface org.jfuncmachine.compiler.model.types.Type
getBoxType, getBoxTypeName, getJVMTypeRepresentation, getStackSize, hasIntRepresentation, isEnum, isUnboxableFrom, sameJavaType
-
Field Details
-
className
The class name of the object -
representsEnum
public final boolean representsEnumTrue if this class represents an enum
-
-
Constructor Details
-
ObjectType
public ObjectType()Create an object type for java.lang.Object -
ObjectType
Create an object type for the given class name- Parameters:
className- The class name of this object type
-
ObjectType
Create an object type from the given class- Parameters:
clazz- The class to extract the class name from
-
ObjectType
Create an object type for the given class name- Parameters:
className- The class name of this object typerepresentsEnum- True if this class is an enum
-
-
Method Details
-
getUnboxedType
Description copied from interface:TypeReturns the unboxed type of this type, if any- Specified by:
getUnboxedTypein interfaceType- Returns:
- The unboxed type of this type, or null if there isn't one
-
isUnboxableTo
Tests whether this object type can be unboxed to a specific type- Parameters:
desiredType- The type that the object should be unboxed to- Returns:
- True if this object type can be unboxed to the desired type
-
isBoxableFrom
Tests whether this object type can be a box for the specified type- Parameters:
desiredType- The type that is supposed to be boxed- Returns:
- True if this object type can serve as a box from the desired type
-
isBoxType
public boolean isBoxType()Description copied from interface:TypeTest whether this type is a box type -
equals
-
hashCode
public int hashCode() -
toString
-