ch.uzh.ifi.attempto.acewiki.core
Class OntologyTextElement

java.lang.Object
  extended by ch.uzh.ifi.attempto.base.TextElement
      extended by ch.uzh.ifi.attempto.acewiki.core.OntologyTextElement

public class OntologyTextElement
extends TextElement

This class represents a text element that links to an ontology element. The text of the text elements corresponds to one of the word forms of the ontology element.

Author:
Tobias Kuhn

Constructor Summary
OntologyTextElement(OntologyElement element, int wordNumber)
          Creates a new ontology text element.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Two text elements are equals if they share the same text.
 OntologyElement getOntologyElement()
          Returns the ontology element to which this text element is linked.
 java.lang.String getOriginalText()
          Returns the original text of this text element.
 java.lang.String getPostText()
          Returns the text added to the end.
 java.lang.String getPreText()
          Returns the text added to the front.
 java.lang.String getText()
          Returns the text of this text element.
 java.lang.String getUnderscoredText()
          Returns the text of this text element in its plain form where underscores are not replaces by blanks.
 int getWordNumber()
          Returns the id of the word form of the ontology element that is used for this text element.
 void setPostText(java.lang.String post)
          This method adds a text to the end of the word of the ontology element.
 void setPreText(java.lang.String pre)
          This method adds a text to the front of the word of the ontology element.
 
Methods inherited from class ch.uzh.ifi.attempto.base.TextElement
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OntologyTextElement

public OntologyTextElement(OntologyElement element,
                           int wordNumber)
Creates a new ontology text element.

Parameters:
element - The ontology element.
wordNumber - The word number.
Method Detail

getUnderscoredText

public java.lang.String getUnderscoredText()
Returns the text of this text element in its plain form where underscores are not replaces by blanks.

Returns:
The plain text.

getText

public java.lang.String getText()
Description copied from class: TextElement
Returns the text of this text element. The text might have been changed by the context checking of the text operator.

Overrides:
getText in class TextElement
Returns:
The text (after context checking).

getOriginalText

public java.lang.String getOriginalText()
Description copied from class: TextElement
Returns the original text of this text element. This is the unchanged text before the context is checked by the text operator.

Overrides:
getOriginalText in class TextElement
Returns:
The original text (before context checking).

setPreText

public void setPreText(java.lang.String pre)
This method adds a text to the front of the word of the ontology element.

Parameters:
pre - The text to be added to the front.

getPreText

public java.lang.String getPreText()
Returns the text added to the front.

Returns:
The text to be added to the front.

setPostText

public void setPostText(java.lang.String post)
This method adds a text to the end of the word of the ontology element.

Parameters:
post - The text to be added to the end.

getPostText

public java.lang.String getPostText()
Returns the text added to the end.

Returns:
The text to be added to the end.

getWordNumber

public int getWordNumber()
Returns the id of the word form of the ontology element that is used for this text element.

Returns:
The word form id.

getOntologyElement

public OntologyElement getOntologyElement()
Returns the ontology element to which this text element is linked.

Returns:
The ontology element.

equals

public boolean equals(java.lang.Object obj)
Description copied from class: TextElement
Two text elements are equals if they share the same text.

Overrides:
equals in class TextElement


Copyright 2008-2012, AceWiki developers