public class MapType extends AnyFunctionType
ItemType.WithSequenceTypeCache
Modifier and Type | Field and Description |
---|---|
static MapType |
ANY_MAP_TYPE |
static MapType |
EMPTY_MAP_TYPE |
static SequenceType |
OPTIONAL_MAP_ITEM
A type that allows a sequence of zero or one map items
|
static SequenceType |
SEQUENCE_OF_MAPS |
static SequenceType |
SINGLE_MAP_ITEM |
ANY_FUNCTION
Constructor and Description |
---|
MapType(AtomicType keyType,
SequenceType valueType) |
MapType(AtomicType keyType,
SequenceType valueType,
boolean mustBeEmpty) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Test whether this function type equals another function type
|
java.util.Optional<java.lang.String> |
explainMismatch(Item item,
TypeHierarchy th)
Get extra diagnostic information about why a supplied item does not conform to this
item type, if available.
|
SequenceType[] |
getArgumentTypes()
Get the argument types of this map, viewed as a function
|
int |
getArity()
Get the arity (number of arguments) of this function type
|
java.lang.String |
getBasicAlphaCode()
Get an alphabetic code representing the type, or at any rate, the nearest built-in type
from which this type is derived.
|
double |
getDefaultPriority()
Get the default priority when this ItemType is used as an XSLT pattern
|
Genre |
getGenre()
Determine the Genre (top-level classification) of this type
|
AtomicType |
getKeyType()
Get the type of the keys
|
SequenceType |
getResultType()
Get the result type of this map, viewed as a function
|
SequenceType |
getValueType()
Get the type of the indexed values
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isArrayType()
Ask whether this function item type is an array type.
|
boolean |
isAtomizable(TypeHierarchy th)
Ask whether values of this type are atomizable
|
boolean |
isMapType()
Ask whether this function item type is a map type.
|
Expression |
makeFunctionSequenceCoercer(Expression exp,
RoleDiagnostic role)
Create an expression whose effect is to apply function coercion to coerce a function from this type to another type
|
boolean |
matches(Item item,
TypeHierarchy th)
Test whether a given item conforms to this type
|
Affinity |
relationship(FunctionItemType other,
TypeHierarchy th)
Determine the relationship of one function item type to another
|
java.lang.String |
toExportString()
Return a string representation of this ItemType suitable for use in stylesheet
export files.
|
java.lang.String |
toString()
Produce a representation of this type name for use in error messages.
|
getAnnotationAssertions, getAtomizedItemType, getInstance, getPrimitiveItemType, getPrimitiveType, getUType, isAtomicType, isPlainType
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFullAlphaCode, getNormalizedDefaultPriority, isTrueItemType
public static final MapType ANY_MAP_TYPE
public static final MapType EMPTY_MAP_TYPE
public static final SequenceType OPTIONAL_MAP_ITEM
public static final SequenceType SINGLE_MAP_ITEM
public static final SequenceType SEQUENCE_OF_MAPS
public MapType(AtomicType keyType, SequenceType valueType)
public MapType(AtomicType keyType, SequenceType valueType, boolean mustBeEmpty)
public Genre getGenre()
Genre.MAP
public AtomicType getKeyType()
public SequenceType getValueType()
public boolean isMapType()
isMapType
in interface FunctionItemType
isMapType
in class AnyFunctionType
public boolean isArrayType()
isArrayType
in interface FunctionItemType
isArrayType
in class AnyFunctionType
public java.lang.String getBasicAlphaCode()
getBasicAlphaCode
in interface ItemType
getBasicAlphaCode
in class AnyFunctionType
public boolean isAtomizable(TypeHierarchy th)
isAtomizable
in interface ItemType
isAtomizable
in class AnyFunctionType
th
- The type hierarchy cachepublic double getDefaultPriority()
getDefaultPriority
in interface ItemType
getDefaultPriority
in class AnyFunctionType
public boolean matches(Item item, TypeHierarchy th)
matches
in interface ItemType
matches
in class AnyFunctionType
item
- The item to be testedth
- public int getArity()
public SequenceType[] getArgumentTypes()
getArgumentTypes
in interface FunctionItemType
getArgumentTypes
in class AnyFunctionType
public SequenceType getResultType()
getResultType
in interface FunctionItemType
getResultType
in class AnyFunctionType
public java.lang.String toString()
toString
in interface ItemType
toString
in class AnyFunctionType
public java.lang.String toExportString()
#toString()
.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Affinity relationship(FunctionItemType other, TypeHierarchy th)
relationship
in interface FunctionItemType
relationship
in class AnyFunctionType
Affinity.SUBSUMES
, Affinity.SAME_TYPE
public java.util.Optional<java.lang.String> explainMismatch(Item item, TypeHierarchy th)
item
- the item that doesn't match this typeth
- the type hierarchy cachepublic Expression makeFunctionSequenceCoercer(Expression exp, RoleDiagnostic role) throws XPathException
AnyFunctionType
makeFunctionSequenceCoercer
in interface FunctionItemType
makeFunctionSequenceCoercer
in class AnyFunctionType
exp
- the expression that delivers the supplied sequence of function items (the ones in need of coercion)role
- information for use in diagnosticsXPathException
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.