candy
Interface CandyMachine

All Known Implementing Classes:
BiggerCandyMachine, BiggerCandyMachine0, ChickletMachine, DoubleCandyMachine, GumballMachine

public interface CandyMachine

A machine that dispenses candy. Newly created candy machines must always have at least one piece of candy.

Version:
1.0.1 of September 2004
Author:
Samuel A. Rebelsky

Method Summary
 java.lang.String get()
          Get a piece of candy.
 boolean isEmpty()
          Determine if the machine is empty.
 

Method Detail

get

public java.lang.String get()
                     throws CandyMachineException
Get a piece of candy.

Throws:
CandyMachineException - If unable to return a piece of candy (e.g., if empty).

isEmpty

public boolean isEmpty()
Determine if the machine is empty.