package org.grobid.core.data;

import java.util.*;

/**
 * Structure for representing the different information for a citation and its different context of citation.
 *
 * @author Patrice Lopez
 */
public class BibDataSet {

    private BiblioItem resBib = null; // identified parsed bibliographical item
    private List<String> sourceBib = null;
    // the context window (raw text) where the bibliographical item is cited
    private String refSymbol = null; // reference marker in the text body
    private String rawBib = null; // raw text of the bibliographical item
    private double confidence = 0.0; // confidence score of the extracted bibiliographical item
    private List<Integer> offsets = null; // list of offsets corresponding to the position of the reference

    //private List<grisp.nlp.Term> terms = null;
    // set of terms describing the reference obtained in the citation context

    public BibDataSet() {
    }

    public void setResBib(BiblioItem res) {
        resBib = res;
    }

    public void addSourceBib(String sentence) {
        if (sourceBib == null)
            sourceBib = new ArrayList<String>();
        //sourceBib.add(org.grobid.core.utilities.TextUtilities.HTMLEncode(sentence));
        sourceBib.add(sentence);
    }

    public void setRawBib(String s) {
        //rawBib = org.grobid.core.utilities.TextUtilities.HTMLEncode(s);
        rawBib = s;
    }

    public void setRefSymbol(String s) {
        refSymbol = s;
    }

    //public void setTerms(List<grisp.nlp.Term> a) { terms = a; }
    public void setConfidence(double c) {
        confidence = c;
    }

    public BiblioItem getResBib() {
        return resBib;
    }

    public String getRawBib() {
        return rawBib;
    }

    public String getRefSymbol() {
        return refSymbol;
    }

    public List<String> getSourceBib() {
        return sourceBib;
    }
    //public List<grisp.nlp.Term> getTerms() { return terms; }

    public double getConfidence() {
        return confidence;
    }

    public void addOffset(int begin) {
        if (offsets == null) {
            offsets = new ArrayList<Integer>();
        }
        offsets.add(new Integer(begin));
    }

    public void addOffset(Integer begin) {
        if (offsets == null) {
            offsets = new ArrayList<Integer>();
        }
        offsets.add(begin);
    }

    public List<Integer> getOffsets() {
        return offsets;
    }
}

@@ -2512,12 +2512,277 @@
 %0D%0A    %7D%0D
+%0A%0D%0A%09@Override%0D%0A%09public String toString() %7B%0D%0A%09%09return %22BibDataSet %5BresBib=%22 + resBib.toString() + %22, sourceBib=%22 + sourceBib%0D%0A%09%09%09%09+ %22, refSymbol=%22 + refSymbol + %22, rawBib=%22 + rawBib%0D%0A%09%09%09%09+ %22, confidence=%22 + confidence + %22, offsets=%22 + offsets + %22%5D%22;%0D%0A%09%7D%0D%0A    %0D%0A    %0D
 %0A%7D%0D%0A

Add toString method.