public class GumballMachine extends java.rmi.server.UnicastRemoteObject implements GumballMachineRemote
Modifier and Type | Field and Description |
---|---|
(package private) int |
count |
(package private) State |
hasQuarterState |
(package private) java.lang.String |
location |
(package private) State |
noQuarterState |
(package private) State |
soldOutState |
(package private) State |
soldState |
(package private) State |
state |
(package private) State |
winnerState |
Constructor and Description |
---|
GumballMachine(java.lang.String location,
int numberGumballs) |
Modifier and Type | Method and Description |
---|---|
void |
ejectQuarter() |
int |
getCount() |
State |
getHasQuarterState() |
java.lang.String |
getLocation() |
State |
getNoQuarterState() |
State |
getSoldOutState() |
State |
getSoldState() |
State |
getState() |
State |
getWinnerState() |
void |
insertQuarter() |
void |
refill(int count) |
(package private) void |
releaseBall() |
(package private) void |
setState(State state) |
java.lang.String |
toString() |
void |
turnCrank() |
State soldOutState
State noQuarterState
State hasQuarterState
State winnerState
int count
java.lang.String location
public GumballMachine(java.lang.String location, int numberGumballs) throws java.rmi.RemoteException
java.rmi.RemoteException
public void insertQuarter()
public void ejectQuarter()
public void turnCrank()
void releaseBall()
public void refill(int count)
public int getCount()
getCount
in interface GumballMachineRemote
public State getState()
getState
in interface GumballMachineRemote
public java.lang.String getLocation()
getLocation
in interface GumballMachineRemote
public State getSoldOutState()
public State getNoQuarterState()
public State getHasQuarterState()
public State getSoldState()
public State getWinnerState()
public java.lang.String toString()
toString
in class java.rmi.server.RemoteObject