package test4; /** * A table is a piece of furniture. Each table * has a collection of legs. The table and its collection * of legs form a composition. */ public class Table extends Furniture implements Comparable { /** * Initializes this table with the given brand and the * given collection of legs. * * @param brand the brand of the table. * @pre. brand != null * @param legs the legs of the table. * @pre. legs != null */ public Table(String brand, Set legs) { } /** * Returns the legs of this table. * * @return the legs of this table. */ public Set getLegs() { } /** * Sets the legs of this table to the given collection of legs. * * @param legs the legs of this table. * @pre. legs != null */ public void setLegs(Set legs) { } /** * Tests for equality of this table and the given other object. * Two tables are equal if they have the same brand and the * same number of legs. * * @param object Another object. * @return true if this table and the other are the same, false otherwise. */ public boolean equals(Object object) { } /** * Compares this table with the given table. * This table is smaller than the other table if its unique id * is smaller than the unique id of the other table. * * @param other Another table. * @return (unique id of this table) - (unique id of other table). * @throws NullPointerException if other is null. */ public int compareTo(Table other) { } }