Class KeyMap<K>

  • Type Parameters:
    K -
    All Implemented Interfaces:
    Map<K,​K>

    public class KeyMap<K>
    extends Object
    implements Map<K,​K>
    fake map, return always the key as value.
    Author:
    Patrick Vandermaesen
    • Field Detail

      • stringInstance

        public static KeyMap<String> stringInstance
    • Constructor Detail

      • KeyMap

        public KeyMap()
    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface Map<K,​K>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<K,​K>
      • containsKey

        public boolean containsKey​(Object key)
        Specified by:
        containsKey in interface Map<K,​K>
      • get

        public K get​(Object key)
        Specified by:
        get in interface Map<K,​K>
      • put

        public K put​(K key,
                     K value)
        Specified by:
        put in interface Map<K,​K>
      • remove

        public K remove​(Object key)
        Specified by:
        remove in interface Map<K,​K>
      • putAll

        public void putAll​(Map<? extends K,​? extends K> m)
        Specified by:
        putAll in interface Map<K,​K>
      • clear

        public void clear()
        Specified by:
        clear in interface Map<K,​K>
      • keySet

        public Set<K> keySet()
        Specified by:
        keySet in interface Map<K,​K>