Package org.qiunet.utils.collection.safe
Class SafeMap<KEY,VAL>
java.lang.Object
org.qiunet.utils.collection.safe.SafeMap<KEY,VAL>
- All Implemented Interfaces:
Map<KEY,,VAL> ISafeCollection
不改变类的情况下. 将集合可以定义为不可修改的集合.
* 用于配置等地方.
- Author:
- qiunet Created on 17/3/1 16:35.
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) void将集合转为安全集合.entrySet()booleanisEmpty()keySet()voidvoidintsize()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
SafeMap
public SafeMap(int initialCapacity, float loadFactor) -
SafeMap
public SafeMap(int initialCapacity) -
SafeMap
public SafeMap() -
SafeMap
-
SafeMap
public SafeMap(int initialCapacity, float loadFactor, boolean accessOrder)
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<KEY,VAL>
-
containsValue
- Specified by:
containsValuein interfaceMap<KEY,VAL>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
loggerIfAbsent
public void loggerIfAbsent() -
convertToUnmodifiable
public void convertToUnmodifiable()Description copied from interface:ISafeCollection将集合转为安全集合. 不可写.- Specified by:
convertToUnmodifiablein interfaceISafeCollection
-