start of new file
[IRC.git] / Robust / src / Tests / Prefetch / FieldPointer.java
1 public class FieldPointer {
2         Account x;
3         public FieldPointer() {
4         }
5
6         public static void main(String[] args) {
7                 int bal;
8                 FieldPointer fp = new FieldPointer();
9                 fp.x = new Account();
10                 fp.x.name = new String("TestAccount");
11                 fp.x.accountid = new Integer(12345);
12                 fp.x.balance = new Item();
13                 fp.x.balance.i = new Integer(11000);
14                 bal = fp.getBalance(fp.x.accountid);
15                 if(bal < 7500) 
16                         bal = bal + fp.x.getBalance().intValue();
17                 else 
18                         bal = fp.x.getBalance().intValue();
19                 System.printInt(bal);
20         }
21
22         public int getBalance(Integer accountid) {
23                 if(accountid.intValue() > 12000) {
24                         return 10000;
25                 } else {
26                         return 5000;
27                 }
28         }
29 }
30
31 public class Account {
32         String name;
33         Integer accountid;
34         Item balance;
35         public Account() {
36         }
37         public Integer getBalance() {
38                 return balance.i;
39         }
40 }
41
42 public class Item {
43         Integer i;
44         public Item() {
45         }
46 }