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, wait
atomize, call, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getGenre, getItemTypeOfSequence, getOperandRoles, getStringValue, getStringValueCS, getTypedValue, isArray, isKnownToConform, isMap, isTrustedResultType, itemAt, makeNewContext, mapToString, toShortString
argumentArray
getLength, head, isStreamed, iterate, iterator, reduce, subsequence, toGroundedValue
asIterable, materialize
makeRepeatable
public 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)
MapItem
public int size()
MapItem
public boolean isEmpty()
MapItem
public AtomicIterator keys()
MapItem
public java.lang.Iterable<KeyValuePair> keyValuePairs()
MapItem
keyValuePairs
in interface MapItem
public MapItem addEntry(AtomicValue key, GroundedValue<?> value)
MapItem
public MapItem remove(AtomicValue key)
MapItem
public boolean conforms(AtomicType keyType, SequenceType valueType, TypeHierarchy th)
MapItem
public MapType getItemType(TypeHierarchy th)
MapItem
getItemType
in interface MapItem
public UType getKeyUType()
MapItem
getKeyUType
in interface MapItem
public MapItem getBaseItem()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.