1 package debugger.resources.lr;
2
3 import gate.LanguageResource;
4 import gate.Document;
5 import gate.corpora.DocumentImpl;
6
7
13
14 public class LrModel {
16 LanguageResource lr;
17 String storedContent;
18
19 public LrModel(LanguageResource lr) {
20 this.lr = lr;
21 if (lr instanceof Document) {
22 storedContent = ((Document) lr).getContent().toString();
23 }
24 }
25
26 public String getText() {
27 if (lr instanceof Document) {
28 return ((Document) lr).getContent().toString();
29 }
30
36 return "";
37 }
38
39 public String getStoredContent() {
40 return storedContent;
41 }
42
43 public void synchronize() {
44 if (lr instanceof Document) {
45 storedContent = ((Document) lr).getContent().toString();
46 }
47 }
48
49
64 public LanguageResource getLr() {
65 return lr;
66 }
67
68 public boolean equals(Object obj) {
69 if (obj instanceof LrModel) {
70 return this.lr.equals(((LrModel) obj).lr);
71 }
72 return super.equals(obj);
73 }
74
75 public String toString() {
76 return lr.getName();
77 }
78
79 public String getName() {
80 return lr.getName();
81 }
82 }
83