Package org.openjdk.jmc.common.unit
Interface IConstrainedMap<K>
- 
- Type Parameters:
- K- the type of the keys in the map
 - All Known Subinterfaces:
- IDescribedMap<K>,- IMutableConstrainedMap<K>
 - All Known Implementing Classes:
- MutableConstrainedMap,- SimpleConstrainedMap
 
 public interface IConstrainedMap<K>Read only interface for a map where the values are constrained by anIConstraintper 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.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description IMutableConstrainedMap<K>emptyWithSameConstraints()Objectget(K key)Get the mapped value forkey, or null if no value is currently mapped.IConstraint<?>getConstraint(K key)StringgetPersistableString(K key)Get the persistable string of the mapped value forkey, or null if no value is currently mapped.Set<K>keySet()IMutableConstrainedMap<K>mutableCopy()
 
- 
- 
- 
Method Detail- 
keySetSet<K> keySet() - Returns:
- A setof keys which are known to be valid. That is, those that currently are known to have aconstraint. This includes all keys which currently have a value, but additional keys may be included. In other words,get(Object)may returnnullfor some keys included in this set.
 
 - 
getObject get(K key) Get the mapped value forkey, or null if no value is currently mapped. If this method ever returns a non-null value,getConstraint(Object)for the samekeywill from that point forward return the same matching non-null constraint.- Returns:
- the mapped value or null
 
 - 
getConstraintIConstraint<?> getConstraint(K key) - Returns:
- a constraint or null
 
 - 
getPersistableStringString getPersistableString(K key) Get the persistable string of the mapped value forkey, or null if no value is currently mapped. If this method ever returns a non-null value,getConstraint(Object)for the samekeywill from that point forward return the same matching non-null constraint.- Returns:
- a persistable string or null
 
 - 
emptyWithSameConstraintsIMutableConstrainedMap<K> emptyWithSameConstraints() Create an emptymutablemap, with the same initial constraints as thismap. It might be possible to addconstraintsto the created map, depending on the restrictions built into this map.
 - 
mutableCopyIMutableConstrainedMap<K> mutableCopy() Create amutablecopy of thismap, containing the same initial values as this map. It might be possible to addconstraintsto the copy, depending on the restrictions built into this map.
 
- 
 
-