public abstract class DelegatingMapItem extends java.lang.Object implements MapItem
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 and Description |
|---|
DelegatingMapItem(MapItem base)
Create a
DelegatingMapItem that delegates all map-related access
to a specified base map. |
| Modifier and Type | Method and Description |
|---|---|
MapItem |
addEntry(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(AtomicType keyType,
SequenceType valueType,
TypeHierarchy th)
Ask whether the map conforms to a given map type
|
GroundedValue<?> |
get(AtomicValue key)
Get an entry from the Map
|
MapItem |
getBaseItem() |
MapType |
getItemType(TypeHierarchy th)
Get the type of the map.
|
UType |
getKeyUType()
Get the lowest common item type of the keys in the map
|
boolean |
isEmpty()
Ask whether the map is empty
|
AtomicIterator |
keys()
Get the set of all key values in the map.
|
java.lang.Iterable<KeyValuePair> |
keyValuePairs()
Get the set of all key-value pairs in the map
|
MapItem |
remove(AtomicValue key)
Remove an entry from the map
|
int |
size()
Get the size of the map
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitatomize, call, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getGenre, getItemTypeOfSequence, getOperandRoles, getStringValue, getStringValueCS, getTypedValue, isArray, isKnownToConform, isMap, isTrustedResultType, itemAt, makeNewContext, mapToString, toShortStringargumentArraygetLength, head, isStreamed, iterate, iterator, reduce, subsequence, toGroundedValueasIterable, materializemakeRepeatablepublic DelegatingMapItem(MapItem base)
DelegatingMapItem that delegates all map-related access
to a specified base map.base - the map item to which this implementation delegatespublic GroundedValue<?> get(AtomicValue key)
MapItempublic int size()
MapItempublic boolean isEmpty()
MapItempublic AtomicIterator keys()
MapItempublic java.lang.Iterable<KeyValuePair> keyValuePairs()
MapItemkeyValuePairs in interface MapItempublic MapItem addEntry(AtomicValue key, GroundedValue<?> value)
MapItempublic MapItem remove(AtomicValue key)
MapItempublic boolean conforms(AtomicType keyType, SequenceType valueType, TypeHierarchy th)
MapItempublic MapType getItemType(TypeHierarchy th)
MapItemgetItemType in interface MapItempublic UType getKeyUType()
MapItemgetKeyUType in interface MapItempublic MapItem getBaseItem()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.