package test4; /** * A combination lock is a special kind of lock. Each combination lock * has a combination. The combination lock and its combination * form a composition. * */ public class CombinationLock extends Lock { /** * Initializes this combination lock to be open and have the given combination. * * @param combination the combination of this combination lock. * @pre. combination != null */ public CombinationLock(List combination) { } /** * Returns the combination of this combination lock. * * @return the combination of this combination lock. */ public List getCombination() { } /** * Sets the combination of this combination lock to the * given combination. * * @param combination the new combination of this * combination lock. * @pre. combination != null */ public void setCombination(List combination) { } /** * Tests whether this combination lock is the same as the given object. * Two combination locks are the same if they are either both open or * both closed and have the same combination. * * @param object an object. * @return true if this lock is the same as the given object, * false otherwise. */ public boolean equals(Object object) { } /** * Returns the hash code of this lock. * * @return the sum of the digits of the combination of this combination lock * if this combination lock is open, the sum of the digits of the combination * of this combination lock plus 1 if this lock is closed. */ public int hashCode() { } }