Class CharToIntMap
java.lang.Object
ch.randelshofer.fastdoubleparser.chr.CharToIntMap
- All Implemented Interfaces:
CharDigitSet,CharSet
A primitive map Map<char,int>.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(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 Details
-
table
-
-
Constructor Details
-
CharToIntMap
-
CharToIntMap
public CharToIntMap(int maxSize)
-
-
Method Details
-
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)
-