import java.util.Observer; /** * Stores lines. Secret: storage format. * * @author Alexander Schaap * * @param * Type of the lines being stored */ public interface StorageInterface { /** * adds line at the end of the storage * * @param line */ public void add(T line); /** * returns contents of line at given index * * @param index * @return line of type T */ public T get(int index); /** * replaces line at index with given line * * @param index * @param line */ public void set(int index, T line); /** * returns size of the storage * * @return int */ public int length(); /** * Resets the storage, primarily for reuse during testing */ public void reset(); /** * sets sorting algorithm to be provided to Alphabetizer * * @param algorithm * - an implementation of SortInterface */ // public void setSortingAlgorithm(AlphabetizerInterface algorithm); public void connect(Observer o); }