-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRef.java
More file actions
49 lines (39 loc) · 1.13 KB
/
Copy pathRef.java
File metadata and controls
49 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import java.io.Serializable;
public class Ref implements Serializable {
/**
* This class represents a pointer to the record. It is used at the leaves of
* the B+ tree
*/
private static final long serialVersionUID = 1L;
private int indexInPage;
private String pageName;
public Ref(String pageName, int indexInPage) {
this.pageName = pageName;
this.indexInPage = indexInPage;
}
/**
* @return the page at which the record is saved on the hard disk
*/
public String getPage() {
return pageName;
}
/**
* @return the index at which the record is saved in the page
*/
public int getIndexInPage() {
return indexInPage;
}
public String getFileName() {
return this.pageName;
}
public Boolean isEqual(Ref ref) {
if (this.pageName.equals(ref.pageName) && this.indexInPage == ref.indexInPage)
return true;
return false;
}
public String toString() {
String s = "";
s += "PageName:" + this.getFileName() + " RowIndex:" + this.getIndexInPage();
return s;
}
}