*** empty log message ***
[IRC.git] / Robust / Transactions / TransactionalIOSrc / 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     private Byte[] data;
17     private Range range;
18     private boolean unknownoffset;
19     private TransactionLocalFileAttributes belongingto;
20     private 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     public TransactionalFile getOwnertransactionalFile() {
31         return ownertransactionalfile;
32     }
33
34     public void setOwnertransaction(TransactionalFile ownertransaction) {
35         this.ownertransactionalfile = ownertransaction;
36     }
37     
38     
39
40     public Byte[] getData() {
41         return data;
42     }
43
44     public Range getRange() {
45         return range;
46     }
47
48     public boolean isUnknownoffset() {
49         return unknownoffset;
50     }
51
52     public void setData(Byte[] data) {
53         this.data = new Byte[data.length];
54         System.arraycopy(data, 0, this.data, 0, data.length);
55     }
56
57     public void setRange(Range range) {
58         this.range = range;
59     }
60
61     public void setUnknownoffset(boolean unknownoffset) {
62         this.unknownoffset = unknownoffset;
63     }
64
65     public TransactionLocalFileAttributes getBelongingto() {
66         return belongingto;
67     }
68
69     public void setBelongingto(TransactionLocalFileAttributes belongingto) {
70         this.belongingto = belongingto;
71     }
72     
73     
74     public int compareTo(Object other) {
75         WriteOperations tmp = (WriteOperations) other;
76         return this.range.compareTo(tmp.range);
77     }
78     
79     
80     
81
82 }