Package com.saxonica.xsltextn.pedigree
Class DelegatingMapItem
- java.lang.Object
-
- com.saxonica.xsltextn.pedigree.DelegatingMapItem
-
- Direct Known Subclasses:
PedigreeMapItem
public abstract class DelegatingMapItem extends java.lang.Object implements MapItem
ADelegatingMapItem
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
Constructors Constructor Description DelegatingMapItem(MapItem base)
Create aDelegatingMapItem
that delegates all map-related access to a specified base map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 typeGroundedValue
get(AtomicValue key)
Get an entry from the MapMapItem
getBaseItem()
MapType
getItemType(TypeHierarchy th)
Get the type of the map.UType
getKeyUType()
Get the lowest common item type of the keys in the mapboolean
isEmpty()
Ask whether the map is emptyAtomicIterator<? extends AtomicValue>
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 mapMapItem
remove(AtomicValue key)
Remove an entry from the mapint
size()
Get the size of the mapjava.lang.String
toString()
-
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.GroundedValue
asIterable, concatenate, containsNode, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, isStreamed, iterate, reduce, subsequence
-
Methods inherited from interface net.sf.saxon.ma.map.MapItem
atomize, call, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getGenre, getOperandRoles, getStringValue, getStringValueCS, getTypedValue, isArray, isMap, isTrustedResultType, itemAt, makeNewContext, toShortString
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Constructor Detail
-
DelegatingMapItem
public DelegatingMapItem(MapItem base)
Create aDelegatingMapItem
that delegates all map-related access to a specified base map.- Parameters:
base
- the map item to which this implementation delegates
-
-
Method Detail
-
get
public GroundedValue get(AtomicValue key)
Description copied from interface:MapItem
Get an entry from the Map
-
size
public int size()
Description copied from interface:MapItem
Get the size of the map
-
isEmpty
public boolean isEmpty()
Description copied from interface:MapItem
Ask whether the map is empty
-
keys
public AtomicIterator<? extends AtomicValue> keys()
Description copied from interface:MapItem
Get the set of all key values in the map.
-
keyValuePairs
public java.lang.Iterable<KeyValuePair> keyValuePairs()
Description copied from interface:MapItem
Get the set of all key-value pairs in the map- Specified by:
keyValuePairs
in interfaceMapItem
- Returns:
- an iterable containing all the key-value pairs
-
addEntry
public MapItem addEntry(AtomicValue key, GroundedValue value)
Description copied from interface: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
public MapItem remove(AtomicValue key)
Description copied from interface:MapItem
Remove an entry from the map
-
conforms
public boolean conforms(AtomicType keyType, SequenceType valueType, TypeHierarchy th)
Description copied from interface:MapItem
Ask whether the map conforms to a given map type
-
getItemType
public MapType getItemType(TypeHierarchy th)
Description copied from interface: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 interfaceMapItem
- Returns:
- the type of this map
-
getKeyUType
public UType getKeyUType()
Description copied from interface:MapItem
Get the lowest common item type of the keys in the map- Specified by:
getKeyUType
in interfaceMapItem
- Returns:
- the most specific type to which all the keys belong. If the map is empty, return UType.VOID
-
getBaseItem
public MapItem getBaseItem()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-