import java.lang.reflect.Array; /** * ArraySearch class that implements the Search Interface. * @author cs416 * @version 1 * @param Type */ public class ArraySearch> implements Search { private T[] data; /** * Constructor. * @param arr Array of T types */ @SuppressWarnings("unchecked") public ArraySearch(T[] arr) { data = (T[]) Array.newInstance(arr.getClass().getComponentType(), arr.length); System.arraycopy(arr, 0, this.data, 0, arr.length); } /** * isEmpty method. * @return boolean */ public boolean isEmpty() { throw new UnsupportedOperationException("TO BE IMPLEMENTED"); } /** * size method. * @return int */ public int size() { throw new UnsupportedOperationException("TO BE IMPLEMENTED"); } /** * isSorted method. * @return boolean */ public boolean isSorted() { throw new UnsupportedOperationException("TO BE IMPLEMENTED"); } /** * returns the index of the object if it exists or -1 if it does not exist. * @param obj The object to search for * @return int */ public int index(T obj) { throw new UnsupportedOperationException("TO BE IMPLEMENTED"); } }