@Universal public static short[] sliceOf( short[] array, int startIndex, int endIndex ) { final int start = calculateIndex( array, startIndex ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, end index %d, length %d", startIndex, endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
@Universal public static short[] endSliceOf( short[] array, int endIndex ) { Exceptions.requireNonNull( array ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end; // + (endIndex < 0 ? 1 : 0); if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, 0, newArray, 0, newLength ); return newArray; }
@Universal public static short[] slc( short[] array, int startIndex, int endIndex ) { final int start = calculateIndex( array, startIndex ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, end index %d, length %d", startIndex, endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
@Universal public static short[] sliceOf( short[] array, int startIndex, int endIndex ) { final int start = calculateIndex( array, startIndex ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, end index %d, length %d", startIndex, endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
@Universal public static short[] slcEnd( short[] array, int endIndex ) { Exceptions.requireNonNull( array ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end; // + (endIndex < 0 ? 1 : 0); if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, 0, newArray, 0, newLength ); return newArray; }
@Universal public static short[] slcEnd( short[] array, int endIndex ) { Exceptions.requireNonNull( array ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end; // + (endIndex < 0 ? 1 : 0); if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, 0, newArray, 0, newLength ); return newArray; }
@Universal public static short[] endSliceOf( short[] array, int endIndex ) { Exceptions.requireNonNull( array ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end; // + (endIndex < 0 ? 1 : 0); if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, 0, newArray, 0, newLength ); return newArray; }
@Universal public static short[] slc( short[] array, int startIndex, int endIndex ) { final int start = calculateIndex( array, startIndex ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, end index %d, length %d", startIndex, endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
@Universal public static short[] slc( short[] array, int startIndex, int endIndex ) { final int start = calculateIndex( array, startIndex ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, end index %d, length %d", startIndex, endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
@Universal public static short[] sliceOf( short[] array, int startIndex, int endIndex ) { final int start = calculateIndex( array, startIndex ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, end index %d, length %d", startIndex, endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
@Universal public static short[] endSliceOf( short[] array, int endIndex ) { Exceptions.requireNonNull( array ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end; // + (endIndex < 0 ? 1 : 0); if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, 0, newArray, 0, newLength ); return newArray; }
@Universal public static short[] slcEnd( short[] array, int endIndex ) { Exceptions.requireNonNull( array ); final int end = calculateEndIndex( array, endIndex ); final int newLength = end; // + (endIndex < 0 ? 1 : 0); if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", endIndex, array.length ) ); } short[] newArray = new short[ newLength ]; System.arraycopy( array, 0, newArray, 0, newLength ); return newArray; }