public final class MapType extends ContainerType
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
Name of the type.
|
Constructor and Description |
---|
MapType(Type indexType,
Type itemType)
Creates new instance of
MapType . |
Modifier and Type | Method and Description |
---|---|
<T,E extends java.lang.Throwable> |
accept(TypeVisitor<T,E> visitor)
Accepts type visitor.
|
boolean |
assignableTo(Type target)
Returns information whether a value of this type can be assigned to a
variable of another type.
|
protected java.lang.String |
createToString() |
boolean |
equals(java.lang.Object obj) |
Type |
findCommonSubtype(Type other)
Returns the common subtype, i.e.
|
Type |
findCommonSupertype(Type other)
Returns the common supertype, i.e.
|
Type |
getIndexType()
Returns the index type of this array type.
|
java.lang.Class<?> |
getJavaClass()
Returns the Java class represented by this type.
|
Type |
getSupertype()
Returns a direct supertype to this type (or null for "Object" type).
|
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.
|
MapType |
substituteFreeTypes(FreeTypeMapping mapping)
Returns a type where free types are substituted by provided mapping.
|
getItemType, hasFreeTypes, toString
getFreeTypes, isCollection, performConversion
public static final java.lang.String NAME
public Type findCommonSupertype(Type other)
Type
other
.findCommonSupertype
in interface Type
findCommonSupertype
in class AbstractType
public Type findCommonSubtype(Type other)
Type
other
.findCommonSubtype
in interface Type
findCommonSubtype
in class AbstractType
public int hashCode()
hashCode
in class ContainerType
public boolean equals(java.lang.Object obj)
equals
in class ContainerType
public Type getIndexType()
public Type getSupertype()
Type
public boolean assignableTo(Type target)
Type
assignableTo
in interface Type
assignableTo
in class AbstractType
target
- type of the target variablepublic MapType substituteFreeTypes(FreeTypeMapping mapping)
Type
substituteFreeTypes
in interface Type
substituteFreeTypes
in class AbstractType
protected java.lang.String createToString()
createToString
in class ContainerType
public <T,E extends java.lang.Throwable> T accept(TypeVisitor<T,E> visitor) throws E extends java.lang.Throwable
Type
T
- visitor return typevisitor
- visitor to visitE
E extends java.lang.Throwable
public java.lang.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 hasIntersectionType()
hasIntersectionType
in interface Type
hasIntersectionType
in class ContainerType
true
if the type contains an intersection typeCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.