java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.util.CharArrayMap<P>
All Implemented Interfaces:
Cloneable, CharArrayMapper<P>

public final class CharArrayMap<P> extends Object implements CharArrayMapper<P>
This map avoids hashing. This is suitable for few elements or long char arrays because it uses vectorized equals. Vectorized equals is several times faster then calculating hashCode in a loop. This class is not thread safe and callers are responsible for thread safety.
Author:
jkubitz
  • Constructor Details

    • CharArrayMap

      public CharArrayMap()
    • CharArrayMap

      public CharArrayMap(int estimatedSize)
  • Method Details

    • values

      public Collection<P> values()
      Description copied from interface: CharArrayMapper
      Returns a copied collection of values.
      Specified by:
      values in interface CharArrayMapper<P>
      Returns:
      all values in undefined order. The order is not guaranteed to be stable.
    • keys

      public Collection<char[]> keys()
      Description copied from interface: CharArrayMapper
      Returns a copied collection of keys.
      Specified by:
      keys in interface CharArrayMapper<P>
      Returns:
      all keys in undefined order. The order is not guaranteed to be stable.
    • containsKey

      public boolean containsKey(char[] key)
      Specified by:
      containsKey in interface CharArrayMapper<P>
    • get

      public P get(char[] key)
      Specified by:
      get in interface CharArrayMapper<P>
    • put

      public P put(char[] key, P value)
      Specified by:
      put in interface CharArrayMapper<P>
      Returns:
      the previous value
    • size

      public int size()
      Specified by:
      size in interface CharArrayMapper<P>
      Returns:
      the number of keys
    • toString

      public String toString()
      Overrides:
      toString in class Object