Home | History | Annotate | Download | only in primitives

Lines Matching full:value

49    * value.
54 * Returns a hash code for {@code value}; equal to the result of invoking
55 * {@code ((Character) value).hashCode()}.
57 * @param value a primitive {@code char} value
58 * @return a hash code for the value
60 public static int hashCode(char value) {
61 return value;
65 * Returns the {@code char} value that is equal to {@code value}, if possible.
67 * @param value any value in the range of the {@code char} type
68 * @return the {@code char} value that equals {@code value}
69 * @throws IllegalArgumentException if {@code value} is greater than {@link
72 public static char checkedCast(long value) {
73 char result = (char) value;
74 checkArgument(result == value, "Out of range: %s", value);
79 * Returns the {@code char} nearest in value to {@code value}.
81 * @param value any {@code long} value
82 * @return the same value cast to {@code char} if it is in the range of the
86 public static char saturatedCast(long value) {
87 if (value > Character.MAX_VALUE) {
90 if (value < Character.MIN_VALUE) {
93 return (char) value;
97 * Compares the two specified {@code char} 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 char} value
115 * @return {@code true} if {@code array[i] == target} for some value of {@code
119 for (char 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 char} value
182 * Returns the index of the last appearance of the value {@code target} in
186 * @param target a primitive {@code char} 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 2-element byte
269 * ByteBuffer.allocate(2).putChar(value).array()}. For example, the input
270 * value {@code '\\u5432'} would yield the byte array {@code {0x54, 0x32}}.
278 public static byte[] toByteArray(char value) {
280 (byte) (value >> 8),
281 (byte) value};
285 * Returns the {@code char} value whose big-endian representation is
288 * {@code {0x54, 0x32}} would yield the {@code char} value {@code '\\u5432'}.
426 * but any attempt to set a value to {@code null} will result in a {@link