-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLeafCell.java
54 lines (45 loc) · 1.46 KB
/
LeafCell.java
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
50
51
52
53
54
/**
* An inner class that represents an inner node in the leaf structure.
* This node contains a pointer to a record, a pointer to the next inner node and a label (String).
* The public variables are accessed by the Leaf class.
* Natali Boniel, 201122140.
*/
package M1;
public class LeafCell {
double rid; //The record number
String myLabel= new String ("~"); //A specific value of the key field
int flag=0; //A flag to indicate if a record was deleted or not, 0 was deleted, 1 is ok. a cell which was not yet used will get the value 0 as well
//Constructor for objects of class LeafCell
public LeafCell()
{
rid=-1;
}
//Constructor for objects of class LeafCell
//The method receives a LeafCell
//The method updates the Leaf with that cell
public LeafCell(LeafCell lf1)
{
rid=lf1.rid;
myLabel=lf1.myLabel;
flag=1;
}
//The method receives a Record id (rid) number
//The method updates the node with that value
public void updateRid(double myRid)
{
rid=myRid;
flag=1;
}
//The method receives a String
//The method updates the node with that value.
public void updateLabel(String myString)
{
myLabel=myString;
flag=1;
}
//The method deletes a cell.
public void deleteCell()
{
flag=0;
}
}