/* * CS 460: PS 2, Problem 4 * Methods related to variable-length records * * name and email: * partner name and email (if applicable): */ // IMPORTANT: Do NOT add any other import statements! import java.util.Arrays; // needed for tests that use Arrays.toString() public class Problem4 { /* * computeOffsets - determine and return an array of offset values * for a record containing the field values specified in fieldVals */ public static int[] computeOffsets(Object[] fieldVals) { // The following line is provided to satisfy the compiler. // Replace it with your implementation of the method. return null; } /* * computeOffsets - construct and return a string representation * of a variable-length record with a header of offsets * for a record whose field values are specified in fieldVals */ public static String recordString(Object[] fieldVals) { // The following line is provided to satisfy the compiler. // Replace it with your implementation of the method. return null; } /* * fieldLength - return the length of field i in a variable-length * record whose header contains the specified offsets. * Special case: returns -1 if the offsets indicate that the * specified field is null. */ public static int fieldLength(int i, int[] offsets) { // The following line is provided to satisfy the compiler. // Replace it with your implementation of the method. return 0; } public static void main(String[] args) { // Add your test code below. } }