try to get another bm for ppopp paper
[IRC.git] / Robust / src / Benchmarks / SingleTM / Vacation / Reservation_Info.java
1
2 /* =============================================================================
3  * reservation_info_alloc
4  * -- Returns NULL on failure
5  * =============================================================================
6  */
7 public class Reservation_Info {
8   int id;
9   int type;
10   int price;
11
12   public Reservation_Info(int type, int id, int price) {
13     this.type=type;
14     this.id=id;
15     this.price=price;
16   }
17
18
19 /* =============================================================================
20  * reservation_info_compare
21  * -- Returns -1 if A < B, 0 if A = B, 1 if A > B
22  * =============================================================================
23  */
24   public static int reservation_info_compare (Reservation_Info aPtr, Reservation_Info bPtr) {
25     int typeDiff;
26     
27     typeDiff = aPtr.type - bPtr.type;
28     
29     return ((typeDiff != 0) ? (typeDiff) : (aPtr.id - bPtr.id));
30   }
31   
32
33 }
34 /* =============================================================================
35  * reservation_alloc
36  * -- Returns NULL on failure
37  * =============================================================================
38  */