Class AlignmentTools.IdentityMap<K>
java.lang.Object
java.util.AbstractMap<K,K>
org.biojava.nbio.structure.align.util.AlignmentTools.IdentityMap<K>
- Type Parameters:
K
-
- All Implemented Interfaces:
Map<K,
K>
- Enclosing class:
- AlignmentTools
A Map<K,V> can be viewed as a function from K to V. This class represents
the identity function. Getting a value results in the value itself.
The class is a bit inconsistent when representing its contents. On the one hand, containsKey(key) is true for all objects. However, attempting to iterate through the values returns an empty set.
- Author:
- Spencer Bliven
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
IdentityMap
public IdentityMap()
-
-
Method Details
-
get
- Specified by:
get
in interfaceMap<K,
K> - Overrides:
get
in classAbstractMap<K,
K> - Parameters:
key
-- Returns:
- the key
- Throws:
ClassCastException
- if key is not of type K
-
entrySet
Always returns the empty set -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
K> - Overrides:
containsKey
in classAbstractMap<K,
K>
-