it.unimi.dsi.fastutil.Arrays.ensureOffsetLength()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中it.unimi.dsi.fastutil.Arrays.ensureOffsetLength()方法的一些代码示例,展示了Arrays.ensureOffsetLength()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Arrays.ensureOffsetLength()方法的具体详情如下:
包路径:it.unimi.dsi.fastutil.Arrays
类名称:Arrays
方法名:ensureOffsetLength

Arrays.ensureOffsetLength介绍

[英]Ensures that a range given by an offset and a length fits an array of given length.

This method may be used whenever an array range check is needed.
[中]确保由偏移量和长度给定的范围适合给定长度的数组。
只要需要阵列范围检查,就可以使用此方法。

代码示例

代码示例来源:origin: AliView/AliView

/** Ensures that a range given by an offset and a length fits an array.
  *
  * <P>This method may be used whenever an array range check is needed.
  *
  * @param a an array.
  * @param offset a start index.
  * @param length a length (the number of elements in the range).
  * @throws IllegalArgumentException if <code>length</code> is negative.
  * @throws ArrayIndexOutOfBoundsException if <code>offset</code> is negative or <code>offset</code>+<code>length</code> is greater than the array length.
  */
public static void ensureOffsetLength( final boolean[] a, final int offset, final int length ) {
Arrays.ensureOffsetLength( a.length, offset, length );
}
private static final int SMALL = 7;

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static void ensureOffsetLength(final short[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static void ensureOffsetLength(final boolean[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static <K> void ensureOffsetLength(final K[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static void ensureOffsetLength(final byte[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static void ensureOffsetLength(final double[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static void ensureOffsetLength(final long[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static void ensureOffsetLength(final char[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static void ensureOffsetLength(final int[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

代码示例来源:origin: it.unimi.dsi/fastutil

/**
 * Ensures that a range given by an offset and a length fits an array.
 *
 * <p>
 * This method may be used whenever an array range check is needed.
 *
 * @param a
 *            an array.
 * @param offset
 *            a start index.
 * @param length
 *            a length (the number of elements in the range).
 * @throws IllegalArgumentException
 *             if {@code length} is negative.
 * @throws ArrayIndexOutOfBoundsException
 *             if {@code offset} is negative or {@code offset}+{@code length} is
 *             greater than the array length.
 */
public static void ensureOffsetLength(final float[] a, final int offset, final int length) {
  Arrays.ensureOffsetLength(a.length, offset, length);
}
/**

相关文章