Class FiniteMap

  • All Implemented Interfaces:
    Map<String,​Long>

    public class FiniteMap
    extends Object
    implements Map<String,​Long>
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        Map.Entry<K extends Object,​V extends Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      FiniteMap​(Map<String,​Long> m, int maxCapacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      boolean containsKey​(Object key)  
      boolean containsValue​(Object value)  
      Set<Map.Entry<String,​Long>> entrySet()  
      boolean equals​(Object o)  
      Long get​(Object key)  
      Map<String,​Long> getImpl()  
      int getMaxCapacity()  
      boolean isEmpty()  
      boolean isSorted()  
      Set<String> keySet()  
      boolean mergeIfSpace​(String key, Long value, java.util.function.BiFunction<? super Long,​? super Long,​? extends Long> remappingFunction)  
      Long put​(String key, Long value)  
      void putAll​(Map<? extends String,​? extends Long> m)  
      Long remove​(Object key)  
      void setMaxCapacity​(int maxCapacity)  
      int size()  
      void sortByKey​(NavigableMap<String,​Long> newMap)  
      void sortByValue()  
      Collection<Long> values()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • FiniteMap

        public FiniteMap​(Map<String,​Long> m,
                         int maxCapacity)
    • Method Detail

      • getMaxCapacity

        public int getMaxCapacity()
      • setMaxCapacity

        public void setMaxCapacity​(int maxCapacity)
      • sortByValue

        public void sortByValue()
      • sortByKey

        public void sortByKey​(NavigableMap<String,​Long> newMap)
      • getImpl

        public Map<String,​Long> getImpl()
      • isSorted

        public boolean isSorted()
      • mergeIfSpace

        public boolean mergeIfSpace​(String key,
                                    Long value,
                                    java.util.function.BiFunction<? super Long,​? super Long,​? extends Long> remappingFunction)
      • size

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

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

        public boolean containsKey​(Object key)
        Specified by:
        containsKey in interface Map<String,​Long>
      • containsValue

        public boolean containsValue​(Object value)
        Specified by:
        containsValue in interface Map<String,​Long>
      • get

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

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

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

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

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

        public Set<String> keySet()
        Specified by:
        keySet in interface Map<String,​Long>
      • values

        public Collection<Long> values()
        Specified by:
        values in interface Map<String,​Long>
      • entrySet

        public Set<Map.Entry<String,​Long>> entrySet()
        Specified by:
        entrySet in interface Map<String,​Long>
      • equals

        public boolean equals​(Object o)
        Specified by:
        equals in interface Map<String,​Long>
        Overrides:
        equals in class Object