Package com.saxonica.xsltextn.pedigree

## Class PedigreeMapItem

- java.lang.Object
- - com.saxonica.xsltextn.pedigree.DelegatingMapItem
  - - com.saxonica.xsltextn.pedigree.PedigreeMapItem

- All Implemented Interfaces:
    `PedigreeValue`, `Callable`, `MapItem`, `Function`, `GroundedValue`, `Item`, `Sequence`

      public class PedigreeMapItem
      extends DelegatingMapItem
      implements MapItem, PedigreeValue

  A `PedigreeMapItem` represents an XDM map together with a `Pedigree`: that is, retained information about how the map was selected within a JSON-like tree.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PedigreeMapItem​(MapItem base)` | Create a PedigreeMapItem with an empty pedigree
    `PedigreeMapItem​(MapItem base, Pedigree pedigree)` | Create a PedigreeMapItem with a known pedigree

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `GroundedValue` | `get​(AtomicValue key)` | Get the value of the entry in the map with a specified key, retaining information about how that value was selected
    `Pedigree` | `getPedigree()` | Get the pedigree of this map item, providing information as to how it was selected.
    `java.lang.Iterable<KeyValuePair>` | `keyValuePairs()` | Get an iterable collection of key-value pairs representing the entries in this map; any entry whose value is a singleton array or map will itself have a pedigree indicating how it was selected

    - ### Methods inherited from class com.saxonica.xsltextn.pedigree.DelegatingMapItem

      `addEntry, conforms, getBaseItem, getItemType, getKeyUType, isEmpty, keys, remove, size, 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

      `addEntry, atomize, call, conforms, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getGenre, getItemType, getKeyUType, getOperandRoles, getStringValue, getStringValueCS, getTypedValue, isArray, isEmpty, isMap, isTrustedResultType, itemAt, keys, makeNewContext, remove, size, toShortString`

    - ### Methods inherited from interface com.saxonica.xsltextn.pedigree.PedigreeValue

      `getBaseItem, getOrigin`

    - ### Methods inherited from interface net.sf.saxon.om.Sequence

      `makeRepeatable`

- - ### Constructor Detail

    - #### PedigreeMapItem

          public PedigreeMapItem​(MapItem base)

      Create a PedigreeMapItem with an empty pedigree
      Parameters:
        `base` - the underlying map item

    - #### PedigreeMapItem

          public PedigreeMapItem​(MapItem base,
                                 Pedigree pedigree)

      Create a PedigreeMapItem with a known pedigree
      Parameters:
        `base` - the underlying array item

  - ### Method Detail

    - #### get

          public GroundedValue get​(AtomicValue key)

      Get the value of the entry in the map with a specified key, retaining information about how that value was selected
      Specified by:
        `get` in interface `MapItem`
      Overrides:
        `get` in class `DelegatingMapItem`
      Parameters:
        `key` - the key of the required entry
      Returns:
        the corresponding value, which will itself have a pedigree if it is a singleton map or array; or null if there is no entry with this key

    - #### keyValuePairs

          public java.lang.Iterable<KeyValuePair> keyValuePairs()

      Get an iterable collection of key-value pairs representing the entries in this map; any entry whose value is a singleton array or map will itself have a pedigree indicating how it was selected
      Specified by:
        `keyValuePairs` in interface `MapItem`
      Overrides:
        `keyValuePairs` in class `DelegatingMapItem`
      Returns:
        the entries in this map as an iterable collection

    - #### getPedigree

          public Pedigree getPedigree()

      Get the pedigree of this map item, providing information as to how it was selected.
      Specified by:
        `getPedigree` in interface `PedigreeValue`
      Returns:
        the pedigree of this map item