Class NameMap<V>

  • Type Parameters:
    V - Value type

    public class NameMap<V>
    extends java.lang.Object
    Map whose keys are names and can be accessed with and without case sensitivity.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.NavigableMap<java.lang.String,​V> map  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        NameMap()
      Creates a NameMap, initially empty.
      private NameMap​(java.util.NavigableMap<java.lang.String,​V> map)
      Creates a NameSet based on an existing set.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.String name, boolean caseSensitive)
      Returns whether this map contains a given key, with a given case-sensitivity.
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      static <V> NameMap immutableCopyOf​(java.util.Map<java.lang.String,​V> names)
      Creates a NameMap that is an immutable copy of a given map.
      java.util.NavigableMap<java.lang.String,​V> map()
      Returns the underlying map.
      void put​(java.lang.String name, V v)  
      java.util.NavigableMap<java.lang.String,​V> range​(java.lang.String name, boolean caseSensitive)
      Returns a map containing all the entries in the map that match the given name.
      V remove​(java.lang.String key)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • map

        private final java.util.NavigableMap<java.lang.String,​V> map
    • Constructor Detail

      • NameMap

        private NameMap​(java.util.NavigableMap<java.lang.String,​V> map)
        Creates a NameSet based on an existing set.
      • NameMap

        public NameMap()
        Creates a NameMap, initially empty.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • immutableCopyOf

        public static <V> NameMap immutableCopyOf​(java.util.Map<java.lang.String,​V> names)
        Creates a NameMap that is an immutable copy of a given map.
      • put

        public void put​(java.lang.String name,
                        V v)
      • range

        public java.util.NavigableMap<java.lang.String,​V> range​(java.lang.String name,
                                                                      boolean caseSensitive)
        Returns a map containing all the entries in the map that match the given name. If case-sensitive, that map will have 0 or 1 elements; if case-insensitive, it may have 0 or more.
      • containsKey

        public boolean containsKey​(java.lang.String name,
                                   boolean caseSensitive)
        Returns whether this map contains a given key, with a given case-sensitivity.
      • map

        public java.util.NavigableMap<java.lang.String,​V> map()
        Returns the underlying map.
      • remove

        public V remove​(java.lang.String key)