-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAVLNode.java
More file actions
40 lines (37 loc) · 1.07 KB
/
Copy pathAVLNode.java
File metadata and controls
40 lines (37 loc) · 1.07 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
//First Creating the Binary-Tree without the rotations, those will be added further into the project
public class AVLNode {
private String word;
private List frequencyCounter;
private AVLNode left;
private AVLNode right;
public AVLNode(String word,String currentFile){
this.word = word;
this.frequencyCounter = new List();
this.frequencyCounter.insertNode(currentFile);
this.left = null;
this.right = null;
}
public void setLeft(AVLNode node){
this.left = node;
}
public void setRight(AVLNode node){
this.right = node;
}
public AVLNode getLeft(){
return this.left;
}
public AVLNode getRight(){
return this.right;
}
public String getWord(){
return this.word;
}
public void increaseFrequency(String fileName){
frequencyCounter.addNodeFrequency(fileName);
}
public void print(){
System.out.println("Word: "+getWord());
frequencyCounter.print();
System.out.println("==============================");
}
}