*** empty log message ***
[IRC.git] / Robust / Transactions / TransactionalIO / src / TransactionalIO / core / INode.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 /**
9  *
10  * @author navid
11  */
12 public class INode implements Comparable{
13    
14     private String filepath;
15     private long number;
16
17
18     public INode(long number) {
19         this.number = number;
20     }
21     
22     public INode(long number, String filepath) {
23         this(number);
24         this.filepath = filepath;
25     }
26
27     public String getFilepath() {
28         return filepath;
29     }
30
31     public void setFilepath(String filepath) {
32         this.filepath = filepath;
33     }
34     
35     
36     
37     public long getNumber() {
38         return number;
39     }
40
41     public void setNumber(long number) {
42         this.number = number;
43     }
44
45     public int compareTo(Object arg0) {
46         INode other = (INode) arg0;
47         if (this.getNumber() < other.getNumber())
48             return -1;
49         else if (this.getNumber() > other.getNumber())
50             return 1;
51         else{ 
52             System.out.println("Logical Eroor Two Inodes cannot have the same number");
53             return 0;
54         }
55        
56     }
57     
58     
59     
60
61 }