public final class FreeType extends AbstractType
Constructor and Description |
---|
FreeType(String name)
Creates a new free type, with given symbolic name.
|
Modifier and Type | Method and Description |
---|---|
<T,E extends Throwable> |
accept(TypeVisitor<T,E> visitor)
Accepts type visitor.
|
boolean |
equals(Object obj) |
Class<?> |
getJavaClass()
Returns the Java class represented by this type.
|
String |
getName()
Returns the free type name.
|
Type |
getSupertype()
Returns a direct supertype to this type (or null for "Object" type).
|
boolean |
hasFreeTypes() |
int |
hashCode() |
boolean |
hasIntersectionType() |
boolean |
matchesSubtype(Type other,
TypeMapping mapping)
Performs type matching on this type.
|
boolean |
matchesSupertype(Type other,
TypeMapping mapping)
Performs type matching on this type.
|
Type |
substituteFreeTypes(FreeTypeMapping mapping)
Returns a type where free types are substituted by provided mapping.
|
String |
toString()
Returns string representation of this free type in the form
#name . |
assignableTo, findCommonSubtype, findCommonSupertype, getFreeTypes, isCollection, performConversion
public FreeType(String name)
name
- String containing symbolic name for the free typepublic String getName()
public Type getSupertype()
Type
public Type substituteFreeTypes(FreeTypeMapping mapping)
Type
substituteFreeTypes
in interface Type
substituteFreeTypes
in class AbstractType
public String toString()
#name
.toString
in class Object
Object.toString()
public <T,E extends Throwable> T accept(TypeVisitor<T,E> visitor) throws E extends Throwable
Type
T
- visitor return typevisitor
- visitor to visitE
E extends Throwable
public Class<?> getJavaClass()
Type
public boolean matchesSupertype(Type other, TypeMapping mapping)
Type
mapping
. Returns true if
this type matches supertype of other
type.matchesSupertype
in interface Type
matchesSupertype
in class AbstractType
other
typepublic boolean matchesSubtype(Type other, TypeMapping mapping)
Type
mapping
. Returns true if
this type matches subtype of other
type.matchesSubtype
in interface Type
matchesSubtype
in class AbstractType
other
typepublic boolean hasFreeTypes()
hasFreeTypes
in interface Type
hasFreeTypes
in class AbstractType
true
if the type contains a free typepublic boolean hasIntersectionType()
true
if the type contains an intersection typeCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.