Class ImmutableMap<K,V>

  extended by<K,V>

public class ImmutableMap<K,V>
extends Object

An immutable map. The put() operation which adds or clears an entry has the effect of creating a new map that is conceptually a modified copy of the old map; in fact the implementation is designed to share storage as far as possible.

Field Summary
static String NAMESPACE
static SequenceType TYPE
Constructor Summary
          Create an empty map
ImmutableMap(LinkedList<HashMap<K,V>> existing)
          Create a new map based on supplied contents
Method Summary
 V get(K key)
          Get an entry from the Map
 Set<K> keySet()
          Get the set of all key values in the map.
 ImmutableMap<K,V> put(K key, V value)
          Add an entry to the Map
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String NAMESPACE
See Also:
Constant Field Values


public static final SequenceType TYPE
Constructor Detail


public ImmutableMap()
Create an empty map


public ImmutableMap(LinkedList<HashMap<K,V>> existing)
Create a new map based on supplied contents

Method Detail


public ImmutableMap<K,V> put(K key,
                             V value)
Add an entry to the Map


public V get(K key)
Get an entry from the Map


public Set<K> keySet()
Get the set of all key values in the map. This will be a newly constructed set. The objects in the set are XPathComparable values representing the normalized values of the keys

Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.