byte primitives that interpret values as signed. The
corresponding methods that treat the values as unsigned are found in UnsignedBytes, and
the methods for which signedness is not an issue are in Bytes.
See the Guava User Guide article on primitive utilities.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| public static final byte | MAX_POWER_OF_TWO
The largest power of two that can be represented as a signed |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static byte | Returns: thebyte value that equals valueany value in the range of the value)byte typeReturns the |
| public static int | Returns: a negative value ifa is less than b; a positive value if a is
greater than b; or zero if they are equalthe first a, byte byte to comparethe second b)byte to compareCompares the two specified |
| public static String | |
| public static Comparator | |
| public static byte | Returns: the value present inarray that is greater than or equal to every other value
in the arraya nonempty array of array)byte valuesReturns the greatest value present in |
| public static byte | Returns: the value present inarray that is less than or equal to every other value in
the arraya nonempty array of array)byte valuesReturns the least value present in |
| public static byte | Returns: the same value cast tobyte if it is in the range of the byte type,
Byte#MAX_VALUE if it is too large, or Byte#MIN_VALUE if it is too smallany value)long valueReturns the |
| public static void | |
| public static void | sortDescending(byte[] array, int fromIndex, int toIndex)
Sorts the elements of |
| MAX_POWER_OF_TWO | back to summary |
|---|---|
| public static final byte MAX_POWER_OF_TWO The largest power of two that can be represented as a signed
| |
| SignedBytes | back to summary |
|---|---|
| private SignedBytes() | |
| checkedCast | back to summary |
|---|---|
| public static byte checkedCast(long value) Returns the
| |
| compare | back to summary |
|---|---|
| public static int compare(byte a, byte b) Compares the two specified Note this method behaves identically to the JDK 7 method
| |
| join | back to summary |
|---|---|
| public static String join(String separator, byte... array) Returns a string containing the supplied
| |
| lexicographicalComparator | back to summary |
|---|---|
| public static Comparator Returns a comparator that compares two The returned comparator is inconsistent with
| |
| max | back to summary |
|---|---|
| public static byte max(byte... array) Returns the greatest value present in
| |
| min | back to summary |
|---|---|
| public static byte min(byte... array) Returns the least value present in
| |
| saturatedCast | back to summary |
|---|---|
| public static byte saturatedCast(long value) Returns the
| |
| sortDescending | back to summary |
|---|---|
| public static void sortDescending(byte[] array) Sorts the elements of
| |
| sortDescending | back to summary |
|---|---|
| public static void sortDescending(byte[] array, int fromIndex, int toIndex) Sorts the elements of
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final SignedBytes. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(byte[]
the first object to be compared. left, byte[] the second object to be compared. right)Implements java. |
| public String | toString()
Overrides java. |
| public static SignedBytes. | |
| public static SignedBytes. |
| INSTANCE | back to summary |
|---|---|
| public static final SignedBytes. | |
| LexicographicalComparator | back to summary |
|---|---|
| private LexicographicalComparator() | |
| compare | back to summary |
|---|---|
| public int compare(byte[] left, byte[] right) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists. | |
| valueOf | back to summary |
|---|---|
| public static SignedBytes. | |
| values | back to summary |
|---|---|
| public static SignedBytes. | |