public class DictionaryMap extends java.lang.Object implements MapItem
Constructor and Description |
---|
DictionaryMap()
Create an empty dictionary, to which entries can be added using
initialPut(String, GroundedValue) ,
provided this is done before the map is exposed to the outside world. |
Modifier and Type | Method and Description |
---|---|
MapItem |
addEntry(AtomicValue key,
GroundedValue<?> value)
Create a new map containing the existing entries in the map plus an additional entry,
without modifying the original.
|
boolean |
conforms(AtomicType keyType,
SequenceType valueType,
TypeHierarchy th)
Ask whether the map conforms to a given map type
|
GroundedValue<?> |
get(AtomicValue key)
Get an entry from the Map
|
ItemType |
getItemType(TypeHierarchy th)
Get the type of the map.
|
UType |
getKeyUType()
Get the lowest common item type of the keys in the map
|
void |
initialPut(java.lang.String key,
GroundedValue<?> value)
During initial construction of the map, add a key-value pair
|
boolean |
isEmpty()
Ask whether the map is empty
|
AtomicIterator |
keys()
Get the set of all key values in the map.
|
java.lang.Iterable<KeyValuePair> |
keyValuePairs()
Get the set of all key-value pairs in the map
|
MapItem |
remove(AtomicValue key)
Remove an entry from the map
|
int |
size()
Get the size of the map
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
atomize, call, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getGenre, getItemTypeOfSequence, getOperandRoles, getStringValue, getStringValueCS, getTypedValue, isArray, isKnownToConform, isMap, isTrustedResultType, itemAt, makeNewContext, mapToString, toShortString
argumentArray
getLength, head, isStreamed, iterate, iterator, reduce, subsequence, toGroundedValue
asIterable, materialize
makeRepeatable
public DictionaryMap()
initialPut(String, GroundedValue)
,
provided this is done before the map is exposed to the outside world.public void initialPut(java.lang.String key, GroundedValue<?> value)
public GroundedValue<?> get(AtomicValue key)
public int size()
public boolean isEmpty()
public AtomicIterator keys()
public java.lang.Iterable<KeyValuePair> keyValuePairs()
keyValuePairs
in interface MapItem
public MapItem addEntry(AtomicValue key, GroundedValue<?> value)
public MapItem remove(AtomicValue key)
public boolean conforms(AtomicType keyType, SequenceType valueType, TypeHierarchy th)
public ItemType getItemType(TypeHierarchy th)
getItemType
in interface MapItem
th
- the type hierarchy cachepublic UType getKeyUType()
getKeyUType
in interface MapItem
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.