forked from rick2785/JavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATMProxy.java
More file actions
27 lines (16 loc) · 552 Bytes
/
ATMProxy.java
File metadata and controls
27 lines (16 loc) · 552 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// In this situation the proxy both creates and destroys
// an ATMMachine Object
public class ATMProxy implements GetATMData {
// Allows the user to access getATMState in the
// Object ATMMachine
public ATMState getATMState() {
ATMMachine realATMMachine = new ATMMachine();
return realATMMachine.getATMState();
}
// Allows the user to access getCashInMachine
// in the Object ATMMachine
public int getCashInMachine() {
ATMMachine realATMMachine = new ATMMachine();
return realATMMachine.getCashInMachine();
}
}