Class CharArrayMap<P>
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.util.CharArrayMap<P>
- All Implemented Interfaces:
Cloneable
,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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey(char[] key)
get(char[] key)
Collection<char[]>
keys()
Returns a copied collection of keys.int
size()
toString()
values()
Returns a copied collection of values.
-
Constructor Details
-
CharArrayMap
public CharArrayMap() -
CharArrayMap
public CharArrayMap(int estimatedSize)
-
-
Method Details
-
values
Description copied from interface:CharArrayMapper
Returns a copied collection of values.- Specified by:
values
in interfaceCharArrayMapper<P>
- Returns:
- all values in undefined order. The order is not guaranteed to be stable.
-
keys
Description copied from interface:CharArrayMapper
Returns a copied collection of keys.- Specified by:
keys
in interfaceCharArrayMapper<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 interfaceCharArrayMapper<P>
-
get
- Specified by:
get
in interfaceCharArrayMapper<P>
-
put
- Specified by:
put
in interfaceCharArrayMapper<P>
- Returns:
- the previous value
-
size
public int size()- Specified by:
size
in interfaceCharArrayMapper<P>
- Returns:
- the number of keys
-
toString
-