Lines Matching full:value
49 * value.
54 * Returns a hash code for {@code value}; equal to the result of invoking
55 * {@code ((Integer) value).hashCode()}.
57 * @param value a primitive {@code int} value
58 * @return a hash code for the value
60 public static int hashCode(int value) {
61 return value;
65 * Returns the {@code int} value that is equal to {@code value}, if possible.
67 * @param value any value in the range of the {@code int} type
68 * @return the {@code int} value that equals {@code value}
69 * @throws IllegalArgumentException if {@code value} is greater than {@link
72 public static int checkedCast(long value) {
73 int result = (int) value;
74 checkArgument(result == value, "Out of range: %s", value);
79 * Returns the {@code int} nearest in value to {@code value}.
81 * @param value any {@code long} value
82 * @return the same value cast to {@code int} if it is in the range of the
86 public static int saturatedCast(long value) {
87 if (value > Integer.MAX_VALUE) {
90 if (value < Integer.MIN_VALUE) {
93 return (int) value;
97 * Compares the two specified {@code int} values. The sign of the value
102 * @return a negative value if {@code a} is less than {@code b}; a positive
103 * value if {@code a} is greater than {@code b}; or zero if they are equal
114 * @param target a primitive {@code int} value
115 * @return {@code true} if {@code array[i] == target} for some value of {@code
119 for (int value : array) {
120 if (value == target) {
128 * Returns the index of the first appearance of the value {@code target} in
132 * @param target a primitive {@code int} value
182 * Returns the index of the last appearance of the value {@code target} in
186 * @param target a primitive {@code int} value
206 * Returns the least value present in {@code array}.
209 * @return the value present in {@code array} that is less than or equal to
210 * every other value in the array
225 * Returns the greatest value present in {@code array}.
228 * @return the value present in {@code array} that is greater than or equal to
229 * every other value in the array
267 * Returns a big-endian representation of {@code value} in a 4-element byte
268 * array; equivalent to {@code ByteBuffer.allocate(4).putInt(value).array()}.
269 * For example, the input value {@code 0x12131415} would yield the byte array
280 public static byte[] toByteArray(int value) {
282 (byte) (value >> 24),
283 (byte) (value >> 16),
284 (byte) (value >> 8),
285 (byte) value};
289 * Returns the {@code int} value whose big-endian representation is stored in
292 * {0x12, 0x13, 0x14, 0x15, 0x33}} would yield the {@code int} value {@code
433 * but any attempt to set a value to {@code null} will result in a {@link