Class CharToIntMap
- java.lang.Object
-
- ch.randelshofer.fastdoubleparser.chr.CharToIntMap
-
- All Implemented Interfaces:
CharDigitSet,CharSet
final class CharToIntMap extends java.lang.Object implements CharDigitSet, CharSet
A primitive map Map<char,int>.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCharToIntMap.Node
-
Field Summary
Fields Modifier and Type Field Description private CharToIntMap.Node[]table
-
Constructor Summary
Constructors Constructor Description CharToIntMap(int maxSize)CharToIntMap(java.util.Collection<java.lang.Character> chars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(char key)Returns true if the set contains the specified character.private intgetIndex(char key)intgetOrDefault(char key, int defaultValue)voidput(char key, int value)inttoDigit(char ch)Returns a value in the range 0 to 9 if the specified character is a digit.
-
-
-
Field Detail
-
table
private CharToIntMap.Node[] table
-
-
Method Detail
-
containsKey
public boolean containsKey(char key)
Description copied from interface:CharSetReturns true if the set contains the specified character.- Specified by:
containsKeyin interfaceCharSet- Parameters:
key- a character- Returns:
- true if the byte is in the set
-
toDigit
public int toDigit(char ch)
Description copied from interface:CharDigitSetReturns a value in the range 0 to 9 if the specified character is a digit. Otherwise, Returns a value greater than 9.- Specified by:
toDigitin interfaceCharDigitSet- Parameters:
ch- a character- Returns:
- a value in the range 0 to Integer.MAX_VALUE.
-
put
public void put(char key, int value)
-
getIndex
private int getIndex(char key)
-
getOrDefault
public int getOrDefault(char key, int defaultValue)
-
-