K
- the type of the keys in the mappublic interface IConstrainedMap<K>
IConstraint
per key.
Note that as this is read only, its methods shouldn't throw any exceptions. This means that all
implementations must ensure upon creation and insertion that their contents are valid.Modifier and Type | Method and Description |
---|---|
IMutableConstrainedMap<K> |
emptyWithSameConstraints()
|
Object |
get(K key)
Get the mapped value for
key , or null if no value is currently mapped. |
IConstraint<?> |
getConstraint(K key)
|
String |
getPersistableString(K key)
Get the persistable string of the mapped value for
key , or null if no value is
currently mapped. |
Set<K> |
keySet() |
IMutableConstrainedMap<K> |
mutableCopy()
|
Set<K> keySet()
set
of keys which are known to be valid. That is, those that currently
are known to have a constraint
. This includes all keys which
currently have a value, but additional keys may be included. In other words,
get(Object)
may return null
for some keys included in this set.Object get(K key)
key
, or null if no value is currently mapped. If this method
ever returns a non-null value, getConstraint(Object)
for the same key
will
from that point forward return the same matching non-null constraint.null
IConstraint<?> getConstraint(K key)
null
String getPersistableString(K key)
key
, or null if no value is
currently mapped. If this method ever returns a non-null value,
getConstraint(Object)
for the same key
will from that point forward return
the same matching non-null constraint.null
IMutableConstrainedMap<K> emptyWithSameConstraints()
mutable
map, with the same initial constraints
as this map
. It might be possible to add constraints
to the created map, depending on the restrictions built into this map.IMutableConstrainedMap<K> mutableCopy()
mutable
copy of this map
,
containing the same initial values as this map. It might be possible to add
constraints
to the copy, depending on the restrictions built into this
map.Copyright © 2020. All rights reserved.