Module org.jhotdraw8.icollection
Package org.jhotdraw8.icollection.facade
Class ReadOnlyMapFacade<K,V>
java.lang.Object
org.jhotdraw8.icollection.facade.ReadOnlyMapFacade<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
Iterable<Map.Entry<K,,V>> ReadOnlyMap<K,V>
- Direct Known Subclasses:
ReadOnlyNavigableMapFacade,ReadOnlySequencedMapFacade,ReadOnlySortedMapFacade
Provides a
ReadOnlyMap facade to a set of ReadOnlyMap functions.- Author:
- Werner Randelshofer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsEntry(@Nullable Object o) Returns true if this map contains the specified entry.booleancontainsKey(Object key) Returnstrueif this map contains a entry for the specified key.@Nullable VReturns the value to which the key is mapped, ornullif this map contains no entry for the key.booleanisEmpty()Returnstrueif this map contains no entries.iterator()Returns an iterator over the entries contained in this map.intsize()Returns the number of entries contained in this map..Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyMap
asMap, characteristics, containsValue, equals, getOrDefault, hashCode, readOnlyEntrySet, readOnlyKeySet, readOnlyValues, spliterator
-
Field Details
-
iteratorFunction
-
sizeFunction
-
containsKeyFunction
-
getFunction
-
-
Constructor Details
-
ReadOnlyMapFacade
-
ReadOnlyMapFacade
-
ReadOnlyMapFacade
-
-
Method Details
-
get
Description copied from interface:ReadOnlyMapReturns the value to which the key is mapped, ornullif this map contains no entry for the key.- Specified by:
getin interfaceReadOnlyMap<K,V> - Parameters:
key- a key- Returns:
- the mapped value or
null
-
containsKey
Description copied from interface:ReadOnlyMapReturnstrueif this map contains a entry for the specified key.- Specified by:
containsKeyin interfaceReadOnlyMap<K,V> - Parameters:
key- a key- Returns:
trueif this map contains a entry for the specified key
-
isEmpty
public boolean isEmpty()Description copied from interface:ReadOnlyMapReturnstrueif this map contains no entries.- Specified by:
isEmptyin interfaceReadOnlyMap<K,V> - Returns:
trueif empty
-
iterator
Description copied from interface:ReadOnlyMapReturns an iterator over the entries contained in this map. -
size
public int size()Description copied from interface:ReadOnlyMapReturns the number of entries contained in this map..- Specified by:
sizein interfaceReadOnlyMap<K,V> - Returns:
- the number of entries
-
containsEntry
Description copied from interface:ReadOnlyMapReturns true if this map contains the specified entry.- Specified by:
containsEntryin interfaceReadOnlyMap<K,V> - Parameters:
o- an entry (should be aMap.Entry).- Returns:
- true if this map contains the entry
-