becker.xtras.comboLock
Interface IComboLock

All Known Implementing Classes:
SampleComboLock

public interface IComboLock

An interface for a combination lock object. A combination lock is either locked or unlocked. If unlocked, it may be locked again with the lock() command. If locked, it may be unlocked by specifying a combination of three numbers with the unlock command. Each combination lock has its own sequence of three numbers that will unlock it. This sequence is specified when the lock is constructed.

Please see the package description for a more in-depth discussion of using this class.

Author:
Byron Weber Becker

Method Summary
 void addView(IView aView)
          Add a view (graphical user interface) to the lock.
 boolean isLocked()
          Test whether or not the lock is locked.
 void lock()
          Lock the combination lock, assuming it is currently unlocked.
 void unlock(int num1, int num2, int num3)
          Attempt to unlock the combination lock, assuming it is currently locked.
 

Method Detail

isLocked

boolean isLocked()
Test whether or not the lock is locked.

Returns:
true if the combination lock is currently locked; false otherwise.

unlock

void unlock(int num1,
            int num2,
            int num3)
Attempt to unlock the combination lock, assuming it is currently locked. If the lock is already unlocked, calling this method has no effect.

Parameters:
num1 - The first number in the combination
num2 - The second number in the combination
num3 - The third number in the combination

lock

void lock()
Lock the combination lock, assuming it is currently unlocked. If it is already locked, calling this method has no effect.


addView

void addView(IView aView)
Add a view (graphical user interface) to the lock. The view's updateView method must be called each time the lock's state changes.