Class AbstractReplicaCollection.ReplicaMap<K>

  • All Implemented Interfaces:
    java.util.Map<K,​Replica>
    Enclosing class:
    AbstractReplicaCollection<C extends AbstractReplicaCollection<C>>

    protected static class AbstractReplicaCollection.ReplicaMap<K>
    extends java.util.AbstractMap<K,​Replica>
    A simple map that ensures the underlying list's iteration order is maintained, and can be shared with subLists (either produced via subList, or via filter that naturally produced a subList). This permits us to reduce the amount of garbage generated, by not unnecessarily copying, reduces the amount of indirection necessary, as well as ensuring monomorphic callsites. The underlying map is also more efficient, particularly for such small collections as we typically produce.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.Object key)  
      java.util.Set<java.util.Map.Entry<K,​Replica>> entrySet()  
      Replica get​(java.lang.Object key)  
      java.util.Set<K> keySet()  
      Replica remove​(java.lang.Object key)  
      int size()  
      • Methods inherited from class java.util.AbstractMap

        clear, clone, containsValue, equals, hashCode, isEmpty, put, putAll, 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
    • Method Detail

      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<K,​Replica>
        Overrides:
        containsKey in class java.util.AbstractMap<K,​Replica>
      • get

        public Replica get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<K,​Replica>
        Overrides:
        get in class java.util.AbstractMap<K,​Replica>
      • remove

        public Replica remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<K,​Replica>
        Overrides:
        remove in class java.util.AbstractMap<K,​Replica>
      • keySet

        public java.util.Set<K> keySet()
        Specified by:
        keySet in interface java.util.Map<K,​Replica>
        Overrides:
        keySet in class java.util.AbstractMap<K,​Replica>
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​Replica>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<K,​Replica>
        Specified by:
        entrySet in class java.util.AbstractMap<K,​Replica>
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<K,​Replica>
        Overrides:
        size in class java.util.AbstractMap<K,​Replica>