Class DualKeyLinkedMap<A,​B,​V>

  • Type Parameters:
    A - Type of key A. Key A is the primary key.
    B - Type of key B. Key B is the secondary key.
    V - Type of the value

    public class DualKeyLinkedMap<A,​B,​V>
    extends Object
    Map which stores values under two different indices. The mapping of the primary key to the value is backed by LinkedHashMap so that the iteration order over the values and the primary key set is the insertion order. Note that the insertion order is not affected if a primary key is re-inserted into the map. Also note that there is no contract of the iteration order over the secondary key set.
    • Constructor Detail

      • DualKeyLinkedMap

        public DualKeyLinkedMap()
    • Method Detail

      • size

        public int size()
      • getValueByKeyA

        @Nullable
        public V getValueByKeyA​(A aKey)
      • getValueByKeyB

        @Nullable
        public V getValueByKeyB​(B bKey)
      • getKeyAByKeyB

        @Nullable
        public A getKeyAByKeyB​(B bKey)
      • getKeyBByKeyA

        @Nullable
        public B getKeyBByKeyA​(A aKey)
      • put

        @Nullable
        public V put​(A aKey,
                     B bKey,
                     V value)
      • containsKeyA

        public boolean containsKeyA​(A aKey)
      • containsKeyB

        public boolean containsKeyB​(B bKey)
      • removeKeyA

        @Nullable
        public V removeKeyA​(A aKey)
      • removeKeyB

        @Nullable
        public V removeKeyB​(B bKey)
      • keySetA

        public Set<A> keySetA()
      • keySetB

        public Set<B> keySetB()
      • clear

        public void clear()