1 public class Transaction {
9 public String toString() {
11 for(int i=0;i<numEvents();i++) {
14 else if(events[i]==WRITE)
18 s+=" on "+objects[i]+" at "+times[i]+"\n";
23 public static final byte READ=0;
24 public static final byte WRITE=1;
25 public static final byte BARRIER=2;
26 public static final byte DELAY=-1;
28 public Transaction(int size,boolean started) {
29 events=new byte[size];
30 objects=new int[size];
31 indices=new int[size];
36 public int numEvents() {
40 public byte getEvent(int index) {
44 public long getTime(int index) {
48 return alttimes[index];
51 public int getObject(int index) {
52 return objects[index];
55 public int getIndex(int index) {
56 return indices[index];
59 public ObjIndex getObjIndex(int index) {
60 int obj=objects[index];
63 return new ObjIndex(obj, indices[index]);
66 public void setEvent(int index, byte val) {
70 public void setTime(int index, long val) {
78 alttimes=new long[times.length];
79 for(int i=0;i<times.length;i++)
87 public void setObject(int index, int val) {
91 public void setIndex(int index, int val) {