MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / copyOfRange

Method copyOfRange

vm/JavaAPI/src/java/util/Arrays.java:3686–3698  ·  view source on GitHub ↗

Copies elements in original array to a new array, from index start(inclusive) to end(exclusive). The first element (if any) in the new array is original[from], and other elements in the new array are in the original order. The padding value whose index is bigger than or equal to original.length - st

(boolean[] original, int start, int end)

Source from the content-addressed store, hash-verified

3684 * @since 1.6
3685 */
3686 public static boolean[] copyOfRange(boolean[] original, int start, int end) {
3687 if (start <= end) {
3688 if (original.length >= start && 0 <= start) {
3689 int length = end - start;
3690 int copyLength = Math.min(length, original.length - start);
3691 boolean[] copy = new boolean[length];
3692 System.arraycopy(original, start, copy, 0, copyLength);
3693 return copy;
3694 }
3695 throw new ArrayIndexOutOfBoundsException();
3696 }
3697 throw new IllegalArgumentException();
3698 }
3699
3700 public static <T> T[] copyOf(T[] original, int newLength, Class<? extends T[]> newType) {
3701 if (newLength < 0) {

Callers 5

sliceMethod · 0.95
copyOfMethod · 0.95
createImageMethod · 0.95
invokeStatic0Method · 0.45
loadPngMethod · 0.45

Calls 5

minMethod · 0.95
arraycopyMethod · 0.95
newInstanceMethod · 0.95
getComponentTypeMethod · 0.65
getClassMethod · 0.45

Tested by 1

createImageMethod · 0.76