< prev index next >
src/java.base/share/classes/java/util/Objects.java
Print this page
rev 50037 : 8202745: Remove hyphens from "out-of-bounds".
@@ -33,20 +33,20 @@
/**
* This class consists of {@code static} utility methods for operating
* on objects, or checking certain conditions before operation. These utilities
* include {@code null}-safe or {@code null}-tolerant methods for computing the
* hash code of an object, returning a string for an object, comparing two
- * objects, and checking if indexes or sub-range values are out-of-bounds.
+ * objects, and checking if indexes or sub-range values are out of bounds.
*
* @apiNote
* Static methods such as {@link Objects#checkIndex},
* {@link Objects#checkFromToIndex}, and {@link Objects#checkFromIndexSize} are
* provided for the convenience of checking if values corresponding to indexes
- * and sub-ranges are out-of-bounds.
+ * and sub-ranges are out of bounds.
* Variations of these static methods support customization of the runtime
* exception, and corresponding exception detail message, that is thrown when
- * values are out-of-bounds. Such methods accept a functional interface
+ * values are out of bounds. Such methods accept a functional interface
* argument, instances of {@code BiFunction}, that maps out-of-bound values to a
* runtime exception. Care should be taken when using such methods in
* combination with an argument that is a lambda expression, method reference or
* class that capture values. In such cases the cost of capture, related to
* functional interface allocation, may exceed the cost of checking bounds.
@@ -350,22 +350,22 @@
/**
* Checks if the {@code index} is within the bounds of the range from
* {@code 0} (inclusive) to {@code length} (exclusive).
*
- * <p>The {@code index} is defined to be out-of-bounds if any of the
+ * <p>The {@code index} is defined to be out of bounds if any of the
* following inequalities is true:
* <ul>
* <li>{@code index < 0}</li>
* <li>{@code index >= length}</li>
* <li>{@code length < 0}, which is implied from the former inequalities</li>
* </ul>
*
* @param index the index
* @param length the upper-bound (exclusive) of the range
* @return {@code index} if it is within bounds of the range
- * @throws IndexOutOfBoundsException if the {@code index} is out-of-bounds
+ * @throws IndexOutOfBoundsException if the {@code index} is out of bounds
* @since 9
*/
@ForceInline
public static
int checkIndex(int index, int length) {
@@ -375,11 +375,11 @@
/**
* Checks if the sub-range from {@code fromIndex} (inclusive) to
* {@code toIndex} (exclusive) is within the bounds of range from {@code 0}
* (inclusive) to {@code length} (exclusive).
*
- * <p>The sub-range is defined to be out-of-bounds if any of the following
+ * <p>The sub-range is defined to be out of bounds if any of the following
* inequalities is true:
* <ul>
* <li>{@code fromIndex < 0}</li>
* <li>{@code fromIndex > toIndex}</li>
* <li>{@code toIndex > length}</li>
@@ -388,11 +388,11 @@
*
* @param fromIndex the lower-bound (inclusive) of the sub-range
* @param toIndex the upper-bound (exclusive) of the sub-range
* @param length the upper-bound (exclusive) the range
* @return {@code fromIndex} if the sub-range within bounds of the range
- * @throws IndexOutOfBoundsException if the sub-range is out-of-bounds
+ * @throws IndexOutOfBoundsException if the sub-range is out of bounds
* @since 9
*/
public static
int checkFromToIndex(int fromIndex, int toIndex, int length) {
return Preconditions.checkFromToIndex(fromIndex, toIndex, length, null);
@@ -401,11 +401,11 @@
/**
* Checks if the sub-range from {@code fromIndex} (inclusive) to
* {@code fromIndex + size} (exclusive) is within the bounds of range from
* {@code 0} (inclusive) to {@code length} (exclusive).
*
- * <p>The sub-range is defined to be out-of-bounds if any of the following
+ * <p>The sub-range is defined to be out of bounds if any of the following
* inequalities is true:
* <ul>
* <li>{@code fromIndex < 0}</li>
* <li>{@code size < 0}</li>
* <li>{@code fromIndex + size > length}, taking into account integer overflow</li>
@@ -414,11 +414,11 @@
*
* @param fromIndex the lower-bound (inclusive) of the sub-interval
* @param size the size of the sub-range
* @param length the upper-bound (exclusive) of the range
* @return {@code fromIndex} if the sub-range within bounds of the range
- * @throws IndexOutOfBoundsException if the sub-range is out-of-bounds
+ * @throws IndexOutOfBoundsException if the sub-range is out of bounds
* @since 9
*/
public static
int checkFromIndexSize(int fromIndex, int size, int length) {
return Preconditions.checkFromIndexSize(fromIndex, size, length, null);
< prev index next >