Lines Matching full:value
26 * values as <i>unsigned</i> (that is, any negative value {@code b} is treated
27 * as the positive value {@code 256 + b}). The corresponding methods that treat
38 * Returns the {@code byte} value that, when treated as unsigned, is equal to
39 * {@code value}, if possible.
41 * @param value a value between 0 and 255 inclusive
42 * @return the {@code byte} value that, when treated as unsigned, equals
43 * {@code value}
44 * @throws IllegalArgumentException if {@code value} is negative or greater
47 public static byte checkedCast(long value) {
48 checkArgument(value >> 8 == 0, "out of range: %s", value);
49 return (byte) value;
53 * Returns the {@code byte} value that, when treated as unsigned, is nearest
54 * in value to {@code value}.
56 * @param value any {@code long} value
57 * @return {@code (byte) 255} if {@code value >= 255}, {@code (byte) 0} if
58 * {@code value <= 0}, and {@code value} cast to {@code byte} otherwise
60 public static byte saturatedCast(long value) {
61 if (value > 255) {
64 if (value < 0) {
67 return (byte) value;
74 * the value of positive {@code 129}.
78 * @return a negative value if {@code a} is less than {@code b}; a positive
79 * value if {@code a} is greater than {@code b}; or zero if they are equal
86 * Returns the least value present in {@code array}.
89 * @return the value present in {@code array} that is less than or equal to
90 * every other value in the array
106 * Returns the greatest value present in {@code array}.
109 * @return the value present in {@code array} that is greater than or equal
110 * to every other value in the array