Package org.openjdk.jmc.common.unit
Class SimpleConstrainedMap<K>
- java.lang.Object
- 
- org.openjdk.jmc.common.unit.MutableConstrainedMap<K>
- 
- org.openjdk.jmc.common.unit.SimpleConstrainedMap<K>
 
 
- 
- Type Parameters:
- K- the type of the keys in the map
 - All Implemented Interfaces:
- IConstrainedMap<K>,- IMutableConstrainedMap<K>
 
 public class SimpleConstrainedMap<K> extends MutableConstrainedMap<K> Simple constrained map that allows constraints to be added, and an optional fallback constraint.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Map<K,IConstraint<?>>constraintsprotected IConstraint<?>fallback- 
Fields inherited from class org.openjdk.jmc.common.unit.MutableConstrainedMapvalues
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description SimpleConstrainedMap()SimpleConstrainedMap(Map<K,IConstraint<?>> constraints, IConstraint<?> fallback)protectedSimpleConstrainedMap(Map<K,IConstraint<?>> constraints, IConstraint<?> fallback, Map<K,Object> values)SimpleConstrainedMap(IConstraint<?> fallback)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddConstraint(K key, IConstraint<?> constraint)IMutableConstrainedMap<K>emptyWithSameConstraints()IConstraint<?>getConstraint(K key)protected IConstraint<?>getSuggestedConstraint(K key)This method will only be called for keys for whichMutableConstrainedMap.getConstraint(Object)currently returns null for.IMutableConstrainedMap<K>mutableCopy()- 
Methods inherited from class org.openjdk.jmc.common.unit.MutableConstrainedMapget, getPersistableString, keySet, put, put, putPersistedString, putPersistedString
 
- 
 
- 
- 
- 
Field Detail- 
constraintsprotected final Map<K,IConstraint<?>> constraints 
 - 
fallbackprotected final IConstraint<?> fallback 
 
- 
 - 
Constructor Detail- 
SimpleConstrainedMappublic SimpleConstrainedMap() 
 - 
SimpleConstrainedMappublic SimpleConstrainedMap(IConstraint<?> fallback) 
 - 
SimpleConstrainedMappublic SimpleConstrainedMap(Map<K,IConstraint<?>> constraints, IConstraint<?> fallback) 
 - 
SimpleConstrainedMapprotected SimpleConstrainedMap(Map<K,IConstraint<?>> constraints, IConstraint<?> fallback, Map<K,Object> values) 
 
- 
 - 
Method Detail- 
getConstraintpublic IConstraint<?> getConstraint(K key) Description copied from interface:IConstrainedMap- Specified by:
- getConstraintin interface- IConstrainedMap<K>
- Specified by:
- getConstraintin class- MutableConstrainedMap<K>
- Returns:
- a constraint or null
 
 - 
getSuggestedConstraintprotected IConstraint<?> getSuggestedConstraint(K key) Description copied from class:MutableConstrainedMapThis method will only be called for keys for whichMutableConstrainedMap.getConstraint(Object)currently returns null for. Thus, it doesn't matter, and is unspecified, what it would return for keys whichMutableConstrainedMap.getConstraint(Object)return non-null for, which typically simplifies the implementations.- Overrides:
- getSuggestedConstraintin class- MutableConstrainedMap<K>
 
 - 
addConstraintprotected void addConstraint(K key, IConstraint<?> constraint) - Overrides:
- addConstraintin class- MutableConstrainedMap<K>
 
 - 
emptyWithSameConstraintspublic IMutableConstrainedMap<K> emptyWithSameConstraints() Description copied from interface:IConstrainedMapCreate 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.
 - 
mutableCopypublic IMutableConstrainedMap<K> mutableCopy() Description copied from interface:IConstrainedMapCreate 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.
 
- 
 
-