Home | History | Annotate | Download | only in primitives

Lines Matching full:boolean

37  * Static utility methods pertaining to {@code boolean} primitives, that are not
38 * already found in either {@link Boolean} or {@link Arrays}.
49 * {@code ((Boolean) value).hashCode()}.
51 * @param value a primitive {@code boolean} value
54 public static int hashCode(boolean value) {
59 * Compares the two specified {@code boolean} values in the standard way
61 * value returned is the same as that of {@code ((Boolean) a).compareTo(b)}.
63 * @param a the first {@code boolean} to compare
64 * @param b the second {@code boolean} to compare
68 public static int compare(boolean a, boolean b) {
81 * @param array an array of {@code boolean} values, possibly empty
82 * @param target a primitive {@code boolean} value
86 public static boolean contains(boolean[] array, boolean target) {
87 for (boolean value : array) {
103 * @param array an array of {@code boolean} values, possibly empty
104 * @param target a primitive {@code boolean} value
108 public static int indexOf(boolean[] array, boolean target) {
114 boolean[] array, boolean target, int start, int end) {
134 public static int indexOf(boolean[] array, boolean[] target) {
157 * @param array an array of {@code boolean} values, possibly empty
158 * @param target a primitive {@code boolean} value
162 public static int lastIndexOf(boolean[] array, boolean target) {
168 boolean[] array, boolean target, int start, int end) {
179 * For example, {@code concat(new boolean[] {a, b}, new boolean[] {}, new
180 * boolean[] {c}} returns the array {@code {a, b, c}}.
182 * @param arrays zero or more {@code boolean} arrays
186 public static boolean[] concat(boolean[]... arrays) {
188 for (boolean[] array : arrays) {
191 boolean[] result = new boolean[length];
193 for (boolean[] array : arrays) {
216 public static boolean[] ensureCapacity(
217 boolean[] array, int minLength, int padding) {
226 private static boolean[] copyOf(boolean[] original, int length) {
227 boolean[] copy = new boolean[length];
233 * Returns a string containing the supplied {@code boolean} values separated
239 * @param array an array of {@code boolean} values, possibly empty
241 public static String join(String separator, boolean... array) {
257 * Returns a comparator that compares two {@code boolean} arrays
259 * #compare(boolean, boolean)}), the first pair of values that follow any
266 * it is consistent with {@link Arrays#equals(boolean[], boolean[])}.
272 public static Comparator<boolean[]> lexicographicalComparator() {
276 private enum LexicographicalComparator implements Comparator<boolean[]> {
279 public int compare(boolean[] left, boolean[] right) {
292 * Copies a collection of {@code Boolean} instances into a new array of
293 * primitive {@code boolean} values.
302 * @param collection a collection of {@code Boolean} objects
308 public static boolean[] toArray(Collection<Boolean> collection) {
315 boolean[] array = new boolean[len];
317 array[i] = (Boolean) boxedArray[i];
329 * {@code Boolean} objects written to or read from it. For example, whether
336 public static List<Boolean> asList(boolean... backingArray) {
344 private static class BooleanArrayAsList extends AbstractList<Boolean>
346 final boolean[] array;
350 BooleanArrayAsList(boolean[] array) {
354 BooleanArrayAsList(boolean[] array, int start, int end) {
364 @Override public boolean isEmpty() {
368 @Override public Boolean get(int index) {
373 @Override public boolean contains(Object target) {
375 return (target instanceof Boolean)
376 && Booleans.indexOf(array, (Boolean) target, start, end) != -1;
381 if (target instanceof Boolean) {
382 int i = Booleans.indexOf(array, (Boolean) target, start, end);
392 if (target instanceof Boolean) {
393 int i = Booleans.lastIndexOf(array, (Boolean) target, start, end);
401 @Override public Boolean set(int index, Boolean element) {
403 boolean oldValue = array[start + index];
409 /*@Override*/ public List<Boolean> subList(int fromIndex, int toIndex) {
418 @Override public boolean equals(Object object) {
455 boolean[] toBooleanArray() {
458 boolean[] result = new boolean[size];