/* * CS220_ArrayOperations_Interface.java * * Created on Aug 18, 2007 * * by Donald Yessick */ /** * CS220_ArrayOperations_Interface * @author Donald Yessick * @ */ public interface CS220_ArrayOperations_Interface { /* These ideasly would all be static operations * but neither interfaces nor abstract classes * support static method prototype * * This eventually makes sense because of polymorphism. */ //design pattern public void visit(Object [] array, int n, CS220_Visitor_Interface v); // Object_Array_Ops public void setAt(Object x, Object[] array, int index); public void prepend(Object x, Object[] array, int n); public void append(Object x, Object[] array, int n); public void insertAt(Object x, int index, Object[] array, int n); public void print(Object [] array, int n); public void removeAt(int index, Object[] array, int n); public int find(Object x, Object [] array, int n); public Object getAt(Object[] array, int n); //Comparable_Unsorted_Array_Ops public void sort(Comparable[] unsorted, int n); public int sequentialSearch(Comparable x, Comparable[] unsorted, int n); public int min( Comparable[] unsorted, int n); public int max(Comparable[] unsorted, int n); //Comparable_Sorted_Array_Ops public int binarySearch(Comparable x, Comparable[] sorted, int n); public void insert(Comparable x, Comparable[] sorted, int n); public void delete(Comparable x, Comparable[] sorted, int n); }