-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinterfaces.bbj
100 lines (85 loc) · 2.09 KB
/
interfaces.bbj
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
rem ' Payroll
e1! = new Salaried()
e1!.setID(1)
e1!.setName("Mary Jones")
e1!.setMonthlySalary(5000)
e1!.print()
print "GL Account:",e1!.account()
e2! = new Hourly()
e2!.setID(2)
e2!.setName("John Smith")
e2!.setHourlyRate(15)
e2!.setHoursWorked(168)
e2!.print()
print "GL Account:",e2!.account()
REM some comment
interface public Address; REM some comment
REM some comment
method public void address(); REM some comment
REM some comment
interfaceend
interface public Pay
method public void print()
interfaceend
interface public GL
method public BBjNumber account()
interfaceend
interface public Payable extends Pay, GL
method public BBjNumber pay()
interfaceend
class public Employee
field public BBjNumber ID
field public BBjString Name$
classend
class public Salaried extends Employee implements Payable
field public BBjNumber MonthlySalary
method public BBjNumber pay()
methodret #MonthlySalary
methodend
method public void print()
print "Employee",#getID(),": ",#getName()
print #pay():"($###,###.00)"
methodend
method public BBjNumber account()
methodret 11111
methodend
classend
REM some comment
class public Hourly extends Employee implements Payable; REM some comment
REM some comment
field public BBjNumber HourlyRate; REM some comment
field public BBjNumber HoursWorked
REM some comment
method public BBjNumber pay();REM some comment
REM some comment
methodret #HourlyRate*#HoursWorked
REM some comment
methodend
method public void print()
print "Employee",#getID(),": ",#getName()
print #pay():"($###,###.00)"
methodend
method public BBjNumber account()
methodret 22222
methodend
REM some comment
classend
interface Nameable
method public BBjString name()
interfaceend
interface Person extends Nameable
method public BBjNumber id()
interfaceend
class Alice implements Nameable
method public BBjString name()
methodret "Alice"
methodend
classend
class Bob implements Person
method public BBjNumber id()
methodret 12345
methodend
method public BBjString name()
methodret "Bob"
methodend
classend