Saxon.Api

Class DocumentBuilder

Class DomDestination

Class DynamicContext

Class DynamicError

Class EmptyEnumerator

Class ExtensionFunctionCall

Class ExtensionFunctionDefinition

Class InvalidityHandlerWrapper

Class NamespaceConstant

Class NullDestination

Class Processor

Class QName

Class SchemaManager

Class SchemaValidator

Class Serializer

Class StandardLogger

Class StaticContext

Class StaticError

Class TextWriterDestination

Class WhitespacePolicy

Class XPathCompiler

Class XPathExecutable

Class XPathSelector

Class XQueryCompiler

Class XQueryEvaluator

Class XQueryExecutable

Class XdmAnyFunctionType

Class XdmAnyItemType

Class XdmAnyNodeType

Class XdmArray

Class XdmAtomicType

Class XdmAtomicValue

Class XdmDestination

  - Class TreeProtector

Class XdmEmptySequence

Class XdmExternalObjectValue

Class XdmFunctionItem

Class XdmItem

Class XdmItemType

Class XdmMap

Class XdmNode

Class XdmNodeKind

Class XdmSequenceType

Class XdmValue

Class XmlDestination

Class Xslt30Transformer

Class XsltCompiler

Class XsltExecutable

  - Class ParameterDetails

Class XsltPackage

Class XsltTransformer

Enum RecoveryPolicy

Enum SchemaValidationMode

Enum TreeModel

Enum XdmAxis

Interface IInvalidityHandler

Interface IMessageListener

Interface IQueryResolver

Interface IResultDocumentHandler

Interface IXdmEnumerator

Interface IXmlLocation

Interface SchemaResolver

 

Saxon.Api
Class XdmMap


public class XdmMap
extends XdmFunctionItem

The class XdmMap represents a map item in an XPath 3.1 sequence. A map in the XDM data model. A map is a list of zero or more entries, each of which is a pair comprising a key(which is an atomic value) and a value(which is an arbitrary value). The map itself is an XDM item


Field Summary
  value
 
Property Summary
 int Size

Get the number of entries in the map

 
Method Summary
 bool IsEmpty()

Is empty check on the XdmMap

 XdmMap Put(XdmAtomicValue key, XdmValue value)

Create a new map containing an additional (key, value) pair. If there is an existing entry with the same key, it is removed

 XdmMap Remove(XdmAtomicValue key)

Create a new map in which the entry for a given key has been removed. If there is no entry with the same key, the new map has the same content as the old(it may or may not be the same .NET object)

 Dictionary<XdmAtomicValue, XdmValue> AsDictionary()

Return a corresponding .NET Dictionary collection of keys and values.

  public HashSet <XdmAtomicValue>KeySet()()
 bool ContainsKey(object key)

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a keyk such that (key==null ? k==null : key.Equals(k)). (There can be at most one such mapping.)

 XdmValue Get(object key)

Returns the value to which the specified key is mapped, or {@code null} if this map contains no mapping for the key.

 ICollection Values()

Returns a {@link Collection} view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa.If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined.The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

 HashSet<DictionaryEntry> EntrySet()

Returns a {@link Set} view of the mappings contained in this map.

static XdmMap MakeMap(System.Collections.IDictionary input)

Static factory method to construct an XDM map by converting each entry in a supplied generic collection of key/value pairs; IDictionary.The keys in the Dictionary must be convertible to XDM atomic values using the {@link XdmAtomicValue#MakeAtomicValue(Object)} method. The associated values must be convertible to XDM sequences using the {@link XdmValue#MakeValue(Object)} method.

 
Field Detail

value

public  value

Property Detail

Size

public int Size {get; }

Get the number of entries in the map

the number of entries in the map. (Note that the {@link #size()} method returns 1 (one), because an XDM map is an item.)


Method Detail

IsEmpty

public bool IsEmpty()

Is empty check on the XdmMap

Returns:
Returns true if this map contains no key-value mappings.

Put

public XdmMap Put(XdmAtomicValue key,
XdmValue value)

Create a new map containing an additional (key, value) pair. If there is an existing entry with the same key, it is removed

Parameters:
key -
a new map containing the additional entry. The original map is unchanged.
value -
Returns:

Remove

public XdmMap Remove(XdmAtomicValue key)

Create a new map in which the entry for a given key has been removed. If there is no entry with the same key, the new map has the same content as the old(it may or may not be the same .NET object)

Parameters:
key -
The key to which entry to be removed
Returns:
a map without the specified entry. The original map is unchanged.

AsDictionary

public Dictionary<XdmAtomicValue, XdmValue> AsDictionary()

Return a corresponding .NET Dictionary collection of keys and values.

Returns:
a mutable Dictionary from atomic values to (sequence) values, containing the same entries as this map

public HashSet <XdmAtomicValue>KeySet()

public  public HashSet <XdmAtomicValue>KeySet()()

ContainsKey

public bool ContainsKey(object key)

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a keyk such that (key==null ? k==null : key.Equals(k)). (There can be at most one such mapping.)

Parameters:
key -
key key whose presence in this map is to be tested
Returns:
true if this map contains a mapping for the specified key

Get

public XdmValue Get(object key)

Returns the value to which the specified key is mapped, or {@code null} if this map contains no mapping for the key.

Parameters:
key -
key the key whose associated value is to be returned. If this is not an XdmAtomicValue, the method attempts to construct an XdmAtomicValue using the method {@link XdmAtomicValue#MakeAtomicValue(Object)}; it is therefore possible to pass a simple key such as a string or integer.
Returns:
the value to which the specified key is mapped, or {@code null} if this map contains no mapping for the key

Values

public ICollection Values()

Returns a {@link Collection} view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa.If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined.The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:
A collection view of the values contained in this map

EntrySet

public HashSet<DictionaryEntry> EntrySet()

Returns a {@link Set} view of the mappings contained in this map.

Returns:
a set view of the mappings contained in this map

MakeMap

public static XdmMap MakeMap(System.Collections.IDictionary input)

Static factory method to construct an XDM map by converting each entry in a supplied generic collection of key/value pairs; IDictionary.The keys in the Dictionary must be convertible to XDM atomic values using the {@link XdmAtomicValue#MakeAtomicValue(Object)} method. The associated values must be convertible to XDM sequences using the {@link XdmValue#MakeValue(Object)} method.

Parameters:
input -
input the supplied map
Returns:
the resulting XdmMap