Package ch.nolix.core.misc.dataobject
Klasse UnsignedByte
java.lang.Object
ch.nolix.core.misc.dataobject.UnsignedByte
A
UnsignedByte is not mutable.- Version:
- 2019-09-06
- Autor:
- Silvan Wyss
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungUnsignedByte(byte pByte) Creates a newUnsignedBytewith the given pByte.UnsignedByte(int bit1, int bit2, int bit3, int bit4, int bit5, int bit6, int bit7, int bit8) Creates a newUnsignedBytewith the given bits. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic UnsignedBytefromNumber(int number) booleangetBitAt(int index) intgetBitAtAsInt(int index) bytetoByte()inttoInt()
-
Konstruktordetails
-
UnsignedByte
public UnsignedByte(byte pByte) Creates a newUnsignedBytewith 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 newUnsignedBytewith the given bits.- Parameter:
bit1-bit2-bit3-bit4-bit5-bit6-bit7-bit8-
-
-
Methodendetails
-
fromNumber
- Parameter:
number-- Gibt zurück:
- a new
UnsignedBytefrom 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
UnsignedByteas int.
-
toBitString
- Gibt zurück:
- a
Stringwith the bits of the currentUnsignedByte.
-
toByte
public byte toByte()- Gibt zurück:
- the current
UnsignedByteas byte.
-
toInt
public int toInt()- Gibt zurück:
- the current
UnsignedByteas int.
-