Interface TwosComplement

All Known Subinterfaces:
TwosComplement.Signed, TwosComplement.Unsigned
All Known Implementing Classes:
Adapter.AsByte, Adapter.AsByte.Signed, Adapter.AsByte.Unsigned, Adapter.AsInt, Adapter.AsInt.Signed, Adapter.AsInt.Unsigned, Adapter.AsLong, Adapter.AsLong.Signed, Adapter.AsLong.Unsigned, Adapter.AsShort, Adapter.AsShort.Signed, Adapter.AsShort.Unsigned

public interface TwosComplement
Methods that have variants on twos-complement Java types that might be signed or unsigned.

The Signed or Unsigned subinterface below, as appropriate, can be used as a mixin on a class where the right treatment of a Java long, int, short, or byte might be class-specific.

The semantic difference between a short treated as unsigned and a char (also an unsigned 16-bit type) is whether the value is expected to mean what UTF-16 says it means.

  • Method Details

    • unsigned

      boolean unsigned()
    • compare

      int compare(long x, long y)
    • divide

      long divide(long dividend, long divisor)
    • remainder

      long remainder(long dividend, long divisor)
    • parseLong

      long parseLong(CharSequence s, int beginIndex, int endIndex, int radix)
    • deparse

      String deparse(long i, int radix)
    • parseLong

      default long parseLong(CharSequence s, int radix)
    • parseLong

      default long parseLong(CharSequence s)
    • deparse

      default String deparse(long i)
    • compare

      int compare(int x, int y)
    • divide

      int divide(int dividend, int divisor)
    • remainder

      int remainder(int dividend, int divisor)
    • toLong

      long toLong(int i)
    • parseInt

      int parseInt(CharSequence s, int beginIndex, int endIndex, int radix)
    • deparse

      String deparse(int i, int radix)
    • parseInt

      default int parseInt(CharSequence s, int radix)
    • parseInt

      default int parseInt(CharSequence s)
    • deparse

      default String deparse(int i)
    • compare

      int compare(short x, short y)
    • divide

      short divide(short dividend, short divisor)
    • remainder

      short remainder(short dividend, short divisor)
    • toLong

      long toLong(short i)
    • toInt

      int toInt(short i)
    • parseShort

      short parseShort(CharSequence s, int beginIndex, int endIndex, int radix)
    • deparse

      String deparse(short i, int radix)
    • parseShort

      default short parseShort(CharSequence s, int radix)
    • parseShort

      default short parseShort(CharSequence s)
    • deparse

      default String deparse(short i)
    • compare

      int compare(byte x, byte y)
    • divide

      byte divide(byte dividend, byte divisor)
    • remainder

      byte remainder(byte dividend, byte divisor)
    • toLong

      long toLong(byte i)
    • toInt

      int toInt(byte i)
    • toShort

      short toShort(byte i)
    • parseByte

      byte parseByte(CharSequence s, int beginIndex, int endIndex, int radix)
    • deparse

      String deparse(byte i, int radix)
    • parseByte

      default byte parseByte(CharSequence s, int radix)
    • parseByte

      default byte parseByte(CharSequence s)
    • deparse

      default String deparse(byte i)