/** @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public TokenForm(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** * Set the token text. Depending on whether the text is different to the covered text a * {@link TokenForm} annotation is created or not. This method can only be used if the document * text has already been set. If a document text is constructed incrementally, * {@link #setForm(TokenForm)} has to be called manually and whether or not a form is necessary * needs to be determined based on the current state of the document text being built. * * @param aText * the token text. */ public void setText(String aText) { TokenForm form = getForm(); if (aText != null && !aText.equals(getCoveredText())) { // Create form annotation if none is here yet if (form == null) { form = new TokenForm(jcasType.jcas, getBegin(), getEnd()); form.addToIndexes(); } // Set/update form form.setValue(aText); setForm(form); } else if (form != null) { form.removeFromIndexes(); setForm(null); } } }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public TokenForm(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** * @return the form value if there is a {@link TokenForm} annotation linked to this token. */ public String getFormValue() { TokenForm form = getForm(); return form != null ? form.getValue() : null; }
/** * Set the token text. Depending on whether the text is different to the covered text a * {@link TokenForm} annotation is created or not. This method can only be used if the document * text has already been set. If a document text is constructed incrementally, * {@link #setForm(TokenForm)} has to be called manually and whether or not a form is necessary * needs to be determined based on the current state of the document text being built. * * @param aText * the token text. */ public void setText(String aText) { TokenForm form = getForm(); if (aText != null && !aText.equals(getCoveredText())) { // Create form annotation if none is here yet if (form == null) { form = new TokenForm(jcasType.jcas, getBegin(), getEnd()); form.addToIndexes(); } // Set/update form form.setValue(aText); setForm(form); } else if (form != null) { form.removeFromIndexes(); setForm(null); } } }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public TokenForm(JCas jcas) { super(jcas); readObject(); }
/** * @return the form value if there is a {@link TokenForm} annotation linked to this token. */ public String getFormValue() { TokenForm form = getForm(); return form != null ? form.getValue() : null; }
/** @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public TokenForm(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public TokenForm(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public TokenForm(JCas jcas) { super(jcas); readObject(); }