/** * ADT: SpecializedStructureIdea * Description: The idea for a specialized structure * Notes: * 1) The super-ADT for specialized structure ideas * 2) A class that implements this ADT would be an abstract class. */ ADT: SpecializedStructureIdea { //-------------------- Basic Statistics --------------------- /** * Returns number of elements in this structure */ size(); /** * Returns true if this structure contains no elements */ isEmpty(); //--------------------- Adding --------------------- /** * Convenience (familiar protocol) method "add". * Each sub-interface decides and documents what * add does. E.g., for Stack "add" would do a "push". * Note that if an abstract class implements this interface, * then "add" might be declared abstract (and let * subclasses implement). */ add(newElem); //--------------------- Removing --------------------- /** * Resets structure so it is empty * If structure is already empty, then does nothing * No action is performed on the elements * */ removeAll(); //--------------------- Convenience --------------------- /** * Returns a Java "List<E>" containing all elements in this structure * in the proper order for the structure (sub-interface will document) */ toNativeList(); /** * Returns one-line user-friendly message about this object * Helpful method especially for debugging */ toString(); }