/** * Returns the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static int atIndex( final int[] array, final int index ) { final int i = calculateIndex( array, index ); return array[ i ]; }
/** * Sets the value at the given index. * @param array the array you are setting the value to. * @param value the new value. * @return the value */ @Universal public static void atIndex( final int[] array, int index, int value ) { final int i = calculateIndex( array, index ); array[ i ] = value; }
/** * Sets the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static void idx( final int[] array, int index, int value ) { final int i = calculateIndex( array, index ); array[ i ] = value; }
/** * Sets the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static void idx( final int[] array, int index, int value ) { final int i = calculateIndex( array, index ); array[ i ] = value; }
/** * Sets the value at the given index. * @param array the array you are setting the value to. * @param value the new value. * @return the value */ @Universal public static void atIndex( final int[] array, int index, int value ) { final int i = calculateIndex( array, index ); array[ i ] = value; }
/** * Sets the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static void idx( final int[] array, int index, int value ) { final int i = calculateIndex( array, index ); array[ i ] = value; }
/** * Returns the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static int idx( final int[] array, final int index ) { final int i = calculateIndex( array, index ); return array[ i ]; }
/** * Returns the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static int idx( final int[] array, final int index ) { final int i = calculateIndex( array, index ); return array[ i ]; }
/** * Returns the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static int atIndex( final int[] array, final int index ) { final int i = calculateIndex( array, index ); return array[ i ]; }
/** * Sets the value at the given index. * @param array the array you are setting the value to. * @param value the new value. * @return the value */ @Universal public static void atIndex( final int[] array, int index, int value ) { final int i = calculateIndex( array, index ); array[ i ] = value; }
/** * Returns the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static int idx( final int[] array, final int index ) { final int i = calculateIndex( array, index ); return array[ i ]; }
/** * Returns the value at the given index. * @param array the array you are getting the from. * @return the value */ @Universal public static int atIndex( final int[] array, final int index ) { final int i = calculateIndex( array, index ); return array[ i ]; }
/** * Grabs a slice of this array * @param array the array you are getting slice from * @param startIndex the start index of the slice * @return the new slice */ @Universal public static int[] sliceOf( int[] array, int startIndex ) { final int start = calculateIndex( array, startIndex ); final int newLength = array.length - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", startIndex, array.length ) ); } int[] newArray = new int[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
/** * Grabs a slice of this array * @param array the array you are getting slice from * @param startIndex the start index of the slice * @return the new slice */ @Universal public static int[] sliceOf( int[] array, int startIndex ) { final int start = calculateIndex( array, startIndex ); final int newLength = array.length - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", startIndex, array.length ) ); } int[] newArray = new int[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
/** * Grabs a slice of this array * @param array the array you are getting slice from * @param startIndex the start index of the slice * @return the new slice */ @Universal public static int[] slc( int[] array, int startIndex ) { final int start = calculateIndex( array, startIndex ); final int newLength = array.length - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", startIndex, array.length ) ); } int[] newArray = new int[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
/** * Grabs a slice of this array * @param array the array you are getting slice from * @param startIndex the start index of the slice * @return the new slice */ @Universal public static int[] slc( int[] array, int startIndex ) { final int start = calculateIndex( array, startIndex ); final int newLength = array.length - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", startIndex, array.length ) ); } int[] newArray = new int[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
/** * Grabs a slice of this array * @param array the array you are getting slice from * @param startIndex the start index of the slice * @return the new slice */ @Universal public static int[] sliceOf( int[] array, int startIndex ) { final int start = calculateIndex( array, startIndex ); final int newLength = array.length - start; if ( newLength < 0 ) { throw new ArrayIndexOutOfBoundsException( String.format( "start index %d, length %d", startIndex, array.length ) ); } int[] newArray = new int[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
/** * Grabs a slice of this array * @param array the array you are getting slice from * @param startIndex the start index of the slice * @param endIndex the end index of the slice * @return the new slice */ @Universal public static int[] slc( int[] 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 ) ); } int[] newArray = new int[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
/** * Grabs a slice of this array * @param array the array you are getting slice from * @param startIndex the start index of the slice * @param endIndex the end index of the slice * @return the new slice */ @Universal public static int[] sliceOf( int[] 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 ) ); } int[] newArray = new int[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }
/** * Grabs a slice of this array * @param array the array you are getting slice from * @param startIndex the start index of the slice * @param endIndex the end index of the slice * @return the new slice */ @Universal public static int[] slc( int[] 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 ) ); } int[] newArray = new int[ newLength ]; System.arraycopy( array, start, newArray, 0, newLength ); return newArray; }