-
Notifications
You must be signed in to change notification settings - Fork 0
/
DocumentObject.java
40 lines (29 loc) · 1 KB
/
DocumentObject.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
import java.util.LinkedList;
import java.util.Queue;
public class DocumentObject {
private String classifier;
private Queue<String> words;
private int documentID;
public DocumentObject(String classifier){
this.classifier = classifier;
this.words = new LinkedList<String>();
this.documentID = 0;
}
public DocumentObject(String classifier, Queue<String> words){
this.classifier = classifier;
this.words = words;
this.documentID = 0;
}
public DocumentObject(String classifier, Queue<String> words, int id){
this.classifier = classifier;
this.words = words;
this.documentID = id;
}
public void addWord(String word){this.words.add(word);}
public void addWords(Queue<String> words){this.words = words;}
public String getClassifier(){return this.classifier;}
public Queue<String> getWords(){return this.words;}
public int getDocumentLength(){return this.words.size();}
public void changeClassifier(String word){this.classifier = word;}
public int getID(){return this.documentID;}
}