Class RadixIdConverter

java.lang.Object
me.ahoo.cosid.converter.RadixIdConverter
All Implemented Interfaces:
IdConverter, Statistical
Direct Known Subclasses:
Radix36IdConverter, Radix62IdConverter

public abstract class RadixIdConverter extends Object implements IdConverter
  • Field Details

  • Constructor Details

    • RadixIdConverter

      protected RadixIdConverter(boolean padStart, int charSize)
  • Method Details

    • offset

      public static int offset(char digitChar)
    • maxCharSize

      public static int maxCharSize(int radix, int bits)
    • getCharSize

      public int getCharSize()
    • getMaxId

      public long getMaxId()
    • asString

      @Nonnull public String asString(long id)
      Description copied from interface: IdConverter
      convert long type ID to String.
      Specified by:
      asString in interface IdConverter
      Parameters:
      id - long type ID
      Returns:
      String type ID
    • asLong

      public long asLong(@Nonnull String idString)
      Description copied from interface: IdConverter
      convert String type ID to long.
      Specified by:
      asLong in interface IdConverter
      Parameters:
      idString - String type ID
      Returns:
      long type ID
    • stat

      public Stat stat()
      Specified by:
      stat in interface IdConverter
      Specified by:
      stat in interface Statistical