*** empty log message ***
[IRC.git] / Robust / Transactions / TransactionalIO / src / TransactionalIO / core / WriteOperations.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5
6 package TransactionalIO.core;
7
8 import TransactionalIO.Utilities.Range;
9
10 /**
11  *
12  * @author navid
13  */
14 public class WriteOperations implements Comparable{
15     
16     protected byte[] data;
17     protected Range range;
18     private boolean unknownoffset;
19     protected TransactionLocalFileAttributes belongingto;
20     protected TransactionalFile ownertransactionalfile;
21
22     public WriteOperations(byte[] data, Range range, boolean unknownoffset, TransactionalFile ownertransactionalfile, TransactionLocalFileAttributes belongingto) {
23         this.data = data;
24         this.range = range;
25         this.unknownoffset = unknownoffset;
26         this.ownertransactionalfile = ownertransactionalfile;
27         this.belongingto = belongingto;
28     }
29     
30     
31
32    
33   
34
35     public boolean isUnknownoffset() {
36         return unknownoffset;
37     }
38
39     public void setData(byte[] data) {
40         this.data = new byte[data.length];
41         System.arraycopy(data, 0, this.data, 0, data.length);
42     }
43
44
45     public void setUnknownoffset(boolean unknownoffset) {
46         this.unknownoffset = unknownoffset;
47     }
48
49
50     
51     public int compareTo(Object other) {
52         WriteOperations tmp = (WriteOperations) other;
53         return this.range.compareTo(tmp.range);
54     }
55     
56     
57     
58
59 }