Class CharToIntMap

java.lang.Object
ch.randelshofer.fastdoubleparser.chr.CharToIntMap
All Implemented Interfaces:
CharDigitSet, CharSet

final class CharToIntMap extends Object implements CharDigitSet, CharSet
A primitive map Map<char,int>.
  • Field Details

  • Constructor Details

    • CharToIntMap

      public CharToIntMap(Collection<Character> chars)
    • CharToIntMap

      public CharToIntMap(int maxSize)
  • Method Details

    • containsKey

      public boolean containsKey(char key)
      Description copied from interface: CharSet
      Returns true if the set contains the specified character.
      Specified by:
      containsKey in interface CharSet
      Parameters:
      key - a character
      Returns:
      true if the byte is in the set
    • toDigit

      public int toDigit(char ch)
      Description copied from interface: CharDigitSet
      Returns a value in the range 0 to 9 if the specified character is a digit. Otherwise, Returns a value greater than 9.
      Specified by:
      toDigit in interface CharDigitSet
      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)