Package net.sf.saxon.expr.sort
Class CustomMap<K,V>
java.lang.Object
net.sf.saxon.expr.sort.CustomMap<K,V>
A map implementation using a custom equality matcher, to avoid having to wrap
each entry in a wrapper object to achieve customised equality testing.
Note: this doesn't implement Map<K, V>
to save the effort of implementing
methods like size() and iterator() that aren't required for our use cases. These
methods could easily be added without changing the basic design.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CustomMap
-
-
Method Details
-
put
Add an entry to the map- Parameters:
key
- the new keyvalue
- the value to be added.- Returns:
- the previous value for the key if there was one, or null otherwise
-
get
Get the value associated with a given key, or null if absemt- Parameters:
key
- the new key- Returns:
- the value for the key if there is one, or null otherwise
-
containsKey
Ask if a key exists in the set of keys- Parameters:
key
- the requested key- Returns:
- true if it exists
-
keys
List all the keys.- Returns:
- a list of all the keys
-
values
List all the values.- Returns:
- a list of all the values
-