Projekt

Obecné

Profil

Stáhnout (1.87 KB) Statistiky
| Větev: | Tag: | Revize:
1
package cz.zcu.kiv.aswi.fulltextsearch.document;
2

    
3
import org.apache.solr.client.solrj.beans.Field;
4

    
5
import javax.xml.bind.annotation.XmlAccessType;
6
import javax.xml.bind.annotation.XmlAccessorType;
7
import javax.xml.bind.annotation.XmlElement;
8
import java.util.List;
9

    
10
@XmlAccessorType(XmlAccessType.PROPERTY)
11
public class TextLine {
12

    
13
    private Coords coords;
14
    private TextEquiv textEquiv;
15

    
16
    @Field(value = "Word", child = true)
17
    private List<Word> words;
18

    
19
    @Field("id")
20
    private String id;
21

    
22
    @Field("Coords")
23
    private String coordsString;
24

    
25
    @Field("TextEquiv")
26
    private String textEquivString;
27

    
28
    public Coords getCoords() {
29
        return coords;
30
    }
31

    
32
    @XmlElement(name = "Coords")
33
    public void setCoords(Coords coords) {
34
        this.coords = coords;
35
        this.coordsString = coords.getPoints();
36
    }
37

    
38
    public TextEquiv getTextEquiv() {
39
        return textEquiv;
40
    }
41

    
42
    @XmlElement(name = "TextEquiv")
43
    public void setTextEquiv(TextEquiv textEquiv) {
44
        this.textEquiv = textEquiv;
45
        this.textEquivString = textEquiv.getUnicode();
46
    }
47

    
48
    public String getCoordsString() {
49
        return coordsString;
50
    }
51

    
52
    public String getTextEquivString() {
53
        return textEquivString;
54
    }
55

    
56
    public void setCoordsString(String coordsString) {
57
        this.coordsString = coordsString;
58
    }
59

    
60
    public void setTextEquivString(String textEquivString) {
61
        this.textEquivString = textEquivString;
62
    }
63

    
64
    public List<Word> getWords() {
65
        return words;
66
    }
67

    
68
    @XmlElement(name = "Word")
69
    public void setWords(List<Word> words) {
70
        this.words = words;
71
    }
72

    
73
    public String getId() {
74
        return id;
75
    }
76

    
77
    public void setId(String id) {
78
        this.id = id;
79
        for (int i = 0; i < words.size(); i++) {
80
            Word word = words.get(i);
81
            word.setId(id + "_" + i + "_word");
82
        }
83
    }
84
}
(5-5/8)