com.xml_project.morganaxdm
Class Map

java.lang.Object
  extended by com.xml_project.morganaxdm.XdmSequence
      extended by com.xml_project.morganaxdm.XdmItem
          extended by com.xml_project.morganaxdm.Map
All Implemented Interfaces:
java.lang.Iterable<XdmItem>

public class Map
extends XdmItem

A map as defined in XDM 3.1


Field Summary
static Map EmptyMap
           
 
Constructor Summary
  Map(java.util.List<XS_AnyAtomicType> keys, java.util.List<XdmSequence> values, DynamicXQueryContext context)
           
protected Map(Map map)
           
  Map(Map map, XS_AnyAtomicType key, XdmSequence value)
           
  Map(XdmSequence mapsToMerge, com.xml_project.morganaxpath.functions.xpath.map.MAP_merge.MergeStrategy strategy)
           
  Map(XS_AnyAtomicType[] keys, XdmSequence[] values)
           
  Map(XS_AnyAtomicType key, XdmSequence value)
           
 
Method Summary
 AtomizingIterator atomize()
          Returns an AtomizingIterator which gives access to the atomized value of the elements in this sequence.
 boolean contains(XS_AnyAtomicType key)
           
 XdmSequence get(XS_AnyAtomicType key)
           
 java.lang.String getStringValue()
          Returns the string value.
 java.lang.Object getValue()
          Returns the value itself.
static boolean isKeyEqual(XS_AnyAtomicType one, XS_AnyAtomicType two)
           
 boolean isValue()
          Flags, this item is a value as opposed to a node
 XdmSequence keys()
           
 long length()
           
 XdmSequence put(XS_AnyAtomicType key, XdmSequence value)
           
 XdmSequence remove(XS_AnyAtomicType key)
           
 long size()
          Returns the number of elements in this sequence.
 java.lang.String toString()
           
 XdmSequence values()
           
 
Methods inherited from class com.xml_project.morganaxdm.XdmItem
first, get, hasValues, isEmpty, iterator, subSequence
 
Methods inherited from class com.xml_project.morganaxdm.XdmSequence
concat, hasCommonType, normalize, serialize, serialize, serialize, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EmptyMap

public static final Map EmptyMap
Constructor Detail

Map

protected Map(Map map)

Map

public Map(XS_AnyAtomicType key,
           XdmSequence value)

Map

public Map(XS_AnyAtomicType[] keys,
           XdmSequence[] values)

Map

public Map(Map map,
           XS_AnyAtomicType key,
           XdmSequence value)

Map

public Map(XdmSequence mapsToMerge,
           com.xml_project.morganaxpath.functions.xpath.map.MAP_merge.MergeStrategy strategy)
    throws XPathException
Throws:
XPathException

Map

public Map(java.util.List<XS_AnyAtomicType> keys,
           java.util.List<XdmSequence> values,
           DynamicXQueryContext context)
    throws XPathException
Throws:
XPathException
Method Detail

atomize

public AtomizingIterator atomize()
                          throws XPathException
Description copied from class: XdmSequence
Returns an AtomizingIterator which gives access to the atomized value of the elements in this sequence.

Overrides:
atomize in class XdmItem
Returns:
an AtomizingIterator.
Throws:
XPathException - thrown, if the sequence contains elements which cannot be atomized.

isValue

public boolean isValue()
Description copied from class: XdmItem
Flags, this item is a value as opposed to a node

Specified by:
isValue in class XdmItem
Returns:
true, if this item is an XDMValue and not a node()

getStringValue

public java.lang.String getStringValue()
Description copied from class: XdmItem
Returns the string value.

Specified by:
getStringValue in class XdmItem
Returns:
the string value.

getValue

public java.lang.Object getValue()
Description copied from class: XdmItem
Returns the value itself.

Specified by:
getValue in class XdmItem
Returns:
the value.

keys

public XdmSequence keys()
                 throws XPathException
Throws:
XPathException

values

public XdmSequence values()
                   throws XPathException
Throws:
XPathException

size

public long size()
Description copied from class: XdmSequence
Returns the number of elements in this sequence. Invoking this method will convert the underlying sequence to a materialized sequence which will take time and cost memory. See also get(n).

Overrides:
size in class XdmItem
Returns:
the number of elements in this sequence.

length

public long length()

contains

public boolean contains(XS_AnyAtomicType key)

get

public XdmSequence get(XS_AnyAtomicType key)

put

public XdmSequence put(XS_AnyAtomicType key,
                       XdmSequence value)
                throws XPathException
Throws:
XPathException

remove

public XdmSequence remove(XS_AnyAtomicType key)
                   throws XPathException
Throws:
XPathException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isKeyEqual

public static boolean isKeyEqual(XS_AnyAtomicType one,
                                 XS_AnyAtomicType two)