public class CustomMap<K,V>
extends java.lang.Object
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 and Description |
|---|
CustomMap(EqualityMatcher<K> matcher) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(K key)
Ask if a key exists in the set of keys
|
V |
get(K key)
Get the value associated with a given key, or null if absemt
|
java.util.List<K> |
keys()
List all the keys.
|
V |
put(K key,
V value)
Add an entry to the map
|
java.util.List<V> |
values()
List all the values.
|
public CustomMap(EqualityMatcher<K> matcher)
public V put(K key, V value)
key - the new keyvalue - the value to be added.public V get(K key)
key - the new keypublic boolean containsKey(K key)
key - the requested keypublic java.util.List<K> keys()
public java.util.List<V> values()
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.