Class ByteToIntMap
- java.lang.Object
-
- ch.randelshofer.fastdoubleparser.bte.ByteToIntMap
-
- All Implemented Interfaces:
ByteDigitSet,ByteSet
final class ByteToIntMap extends java.lang.Object implements ByteDigitSet, ByteSet
A primitive map Map<char,int>.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classByteToIntMap.Node
-
Field Summary
Fields Modifier and Type Field Description private ByteToIntMap.Node[]table
-
Constructor Summary
Constructors Constructor Description ByteToIntMap(int maxSize)ByteToIntMap(java.util.Collection<java.lang.Character> chars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(byte b)Returns true if the set contains the specified byte.private intgetIndex(byte key)intgetOrDefault(byte key, int defaultValue)voidput(byte key, int value)inttoDigit(byte ch)Returns a value in the range 0 to 9 if the specified character is a digit.
-
-
-
Field Detail
-
table
private ByteToIntMap.Node[] table
-
-
Method Detail
-
containsKey
public boolean containsKey(byte b)
Description copied from interface:ByteSetReturns true if the set contains the specified byte.- Specified by:
containsKeyin interfaceByteSet- Parameters:
b- a byte- Returns:
- true if the byte is in the set
-
toDigit
public int toDigit(byte ch)
Description copied from interface:ByteDigitSetReturns 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 interfaceByteDigitSet- Parameters:
ch- a character- Returns:
- a value in the range 0 to Integer.MAX_VALUE.
-
put
public void put(byte key, int value)
-
getIndex
private int getIndex(byte key)
-
getOrDefault
public int getOrDefault(byte key, int defaultValue)
-
-