Klasse UnsignedByte

java.lang.Object
ch.nolix.core.programatom.unsignedbyte.UnsignedByte

public final class UnsignedByte extends Object
A UnsignedByte is not mutable.
Version:
2019-09-06
Autor:
Silvan Wyss
  • Konstruktordetails

    • UnsignedByte

      public UnsignedByte(byte pByte)
      Creates a new UnsignedByte with the given pByte.
      Parameter:
      pByte -
    • UnsignedByte

      public UnsignedByte(int bit1, int bit2, int bit3, int bit4, int bit5, int bit6, int bit7, int bit8)
      Creates a new UnsignedByte with the given bits.
      Parameter:
      bit1 -
      bit2 -
      bit3 -
      bit4 -
      bit5 -
      bit6 -
      bit7 -
      bit8 -
  • Methodendetails

    • fromNumber

      public static UnsignedByte fromNumber(int number)
      Parameter:
      number -
      Gibt zurück:
      a new UnsignedByte from the given number.
      Löst aus:
      ArgumentIsOutOfRangeException - if the given number is not in [0, 255].
    • getBitAt

      public boolean getBitAt(int index)
      Parameter:
      index -
      Gibt zurück:
      the bit at the given index from the current UnsignedByte.
    • getBitAtAsInt

      public int getBitAtAsInt(int index)
      Parameter:
      index -
      Gibt zurück:
      the bit at the given index from the current UnsignedByte as int.
    • toBitString

      public String toBitString()
      Gibt zurück:
      a String with the bits of the current UnsignedByte.
    • toByte

      public byte toByte()
      Gibt zurück:
      the current UnsignedByte as byte.
    • toInt

      public int toInt()
      Gibt zurück:
      the current UnsignedByte as int.