org.biojava.bio.structure.align.util
Class AlignmentTools.IdentityMap<K>
java.lang.Object
java.util.AbstractMap<K,K>
org.biojava.bio.structure.align.util.AlignmentTools.IdentityMap<K>
- Type Parameters:
K - V -
- All Implemented Interfaces:
- java.util.Map<K,K>
- Enclosing class:
- AlignmentTools
public static class AlignmentTools.IdentityMap<K>
- extends java.util.AbstractMap<K,K>
A Map 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 classes/interfaces inherited from class java.util.AbstractMap |
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
|
Method Summary |
boolean |
containsKey(java.lang.Object key)
|
java.util.Set<java.util.Map.Entry<K,K>> |
entrySet()
Always returns the empty set |
K |
get(java.lang.Object key)
|
| 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 |
AlignmentTools.IdentityMap
public AlignmentTools.IdentityMap()
get
public K get(java.lang.Object key)
- Specified by:
get in interface java.util.Map<K,K>- Overrides:
get in class java.util.AbstractMap<K,K>
- Parameters:
key -
- Returns:
- the key
- Throws:
java.lang.ClassCastException - if key is not of type K
entrySet
public java.util.Set<java.util.Map.Entry<K,K>> entrySet()
- Always returns the empty set
- Specified by:
entrySet in interface java.util.Map<K,K>- Specified by:
entrySet in class java.util.AbstractMap<K,K>
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey in interface java.util.Map<K,K>- Overrides:
containsKey in class java.util.AbstractMap<K,K>