public final class BinaryValuesByte extends Object implements Serializable
byte
binary states in an UnsignedByteBuffer
.
By default, these states are 0
for off and -1
(identical to 255
) for on.
This class is immutable.
See BinaryValuesInt
for an equivalent class that stores these states as int
.
Constructor and Description |
---|
BinaryValuesByte(byte off,
byte on) |
BinaryValuesByte(int off,
int on)
Create with
int values for off and on states. |
Modifier and Type | Method and Description |
---|---|
BinaryValuesInt |
asInt()
Derives a
BinaryValuesInt representation from the current values. |
boolean |
equals(Object o) |
static BinaryValuesByte |
getDefault()
Default values to use, if not otherwise specified.
|
byte |
getOff()
The byte representation of the value for off.
|
byte |
getOn()
The byte representation of the value for on.
|
int |
hashCode() |
BinaryValuesByte |
invert()
Inverts the values so off becomes on, and vice-versa.
|
boolean |
isOff(byte value)
Does a particular value correspond to the off state?
|
boolean |
isOn(byte value)
Does a particular value correspond to the on state?
|
public BinaryValuesByte(int off, int on)
int
values for off and on states.off
- value for the off state.on
- value for the on state.public BinaryValuesByte(byte off, byte on)
public static BinaryValuesByte getDefault()
BinaryValuesByte
with default values (see class
description).public boolean isOn(byte value)
value
- the value to check.public boolean isOff(byte value)
value
- the value to check.public BinaryValuesByte invert()
This is an immutable operation.
BinaryValuesByte
with the off and on values switched.public BinaryValuesInt asInt()
BinaryValuesInt
representation from the current values.
This is a similar structure but holds unsigned int values rather than byte values.
BinaryValuesByte
.public byte getOff()
public byte getOn()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.