Package com.saxonica.xsltextn.pedigree
Class DelegatingMapItem
java.lang.Object
net.sf.saxon.ma.map.MapItem
com.saxonica.xsltextn.pedigree.DelegatingMapItem
- All Implemented Interfaces:
Callable
,FunctionItem
,GroundedValue
,Item
,Sequence
- Direct Known Subclasses:
PedigreeMapItem
A
DelegatingMapItem
is an abstract class representing a map that
is implemented by delegating all map-related functionality to another map.
Unless any methods are overridden, the functionality is identical to that
of the wrapped map item.
Note that methods such as addEntry(net.sf.saxon.value.AtomicValue, net.sf.saxon.om.GroundedValue)
that create a new map will
(unless overridden) simply delegate to the base map, and the new map will
therefore not be a delegating map.
-
Constructor Summary
ConstructorsConstructorDescriptionDelegatingMapItem
(MapItem base) Create aDelegatingMapItem
that delegates all map-related access to a specified base map. -
Method Summary
Modifier and TypeMethodDescriptionaddEntry
(AtomicValue key, GroundedValue value) Create a new map containing the existing entries in the map plus an additional entry, without modifying the original.boolean
conforms
(PlainType keyType, SequenceType valueType, TypeHierarchy th) Ask whether the map conforms to a given map typeget
(AtomicValue key) Get an entry from the MapGet the type of the map.Get the lowest common item type of the keys in the mapboolean
isEmpty()
Ask whether the map is emptykeys()
Get the set of all key values in the map.Get the set of all key-value pairs in the mapremove
(AtomicValue key) Remove an entry from the mapint
size()
Get the size of the maptoString()
Methods inherited from class net.sf.saxon.ma.map.MapItem
atomize, call, deepEqual40, deepEquals, effectiveBooleanValue, entries, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getGenre, getItemTypeOfSequence, getOperandRoles, getTypedValue, getUnicodeStringValue, isArray, isKnownToConform, isMap, isTrustedResultType, itemAt, makeNewContext, mapToString, toShortString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.FunctionItem
isSequenceVariadic
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, head, isStreamed, iterate, reduce, subsequence
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
DelegatingMapItem
Create aDelegatingMapItem
that delegates all map-related access to a specified base map.- Parameters:
base
- the map item to which this implementation delegates
-
-
Method Details
-
get
Description copied from class:MapItem
Get an entry from the Map -
size
public int size()Description copied from class:MapItem
Get the size of the map -
isEmpty
public boolean isEmpty()Description copied from class:MapItem
Ask whether the map is empty -
keys
Description copied from class:MapItem
Get the set of all key values in the map. -
keyValuePairs
Description copied from class:MapItem
Get the set of all key-value pairs in the map- Specified by:
keyValuePairs
in classMapItem
- Returns:
- an iterable containing all the key-value pairs
-
addEntry
Description copied from class:MapItem
Create a new map containing the existing entries in the map plus an additional entry, without modifying the original. If there is already an entry with the specified key, this entry is replaced by the new entry. -
remove
Description copied from class:MapItem
Remove an entry from the map -
conforms
Description copied from class:MapItem
Ask whether the map conforms to a given map type -
getItemType
Description copied from class:MapItem
Get the type of the map. This method is used largely for diagnostics, to report the type of a map when it differs from the required type.- Specified by:
getItemType
in classMapItem
- Parameters:
th
- the type hierarchy cache- Returns:
- the type of this map
-
getKeyUType
Description copied from class:MapItem
Get the lowest common item type of the keys in the map- Specified by:
getKeyUType
in classMapItem
- Returns:
- the most specific type to which all the keys belong. If the map is empty, return UType.VOID
-
getBaseItem
-
toString
-