|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.uzh.ifi.attempto.base.TextContainer
public class TextContainer
This class represents a text container that stores a sequence of text elements that represent a (partial) text or sentence.
| Constructor Summary | |
|---|---|
TextContainer()
Creates a new text container. |
|
TextContainer(TextElement... elements)
Creates a new text container that contains the given text elements. |
|
TextContainer(TextOperator textOperator)
Creates a new text container using the given text operator. |
|
TextContainer(TextOperator textOperator,
TextElement... elements)
Creates a new text container that uses the given text operator and that contains the given text elements. |
|
| Method Summary | |
|---|---|
void |
addElement(TextElement el)
Adds the text element to the end of the sequence. |
TextContainer |
clone()
|
int |
getIndexOf(TextElement textElement)
Returns the position of the given text element within this text container or -1 if the text element is not contained by this text container. |
TextContainer |
getSubTextContainer(int startPos,
int endPos)
Returns a new text container containing a subsequence of the elements of this text container. |
java.lang.String |
getText()
Returns the text that is represented by the sequence of text element as a string. |
TextElement |
getTextElement(int index)
Returns the text element with the given index. |
java.util.List<TextElement> |
getTextElements()
Returns the sequence of text elements. |
int |
getTextElementsCount()
Returns the number of text elements of this text container. |
TextOperator |
getTextOperator()
Returns the text operator of this text container. |
void |
removeAllElements()
Removes all text elements. |
void |
removeLastElement()
Removes the last text element of the sequence if it is not empty. |
void |
setTextElements(java.util.List<TextElement> elements)
Sets the text elements. |
void |
setTextOperator(TextOperator textOperator)
Sets the text operator. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextContainer()
public TextContainer(TextOperator textOperator)
textOperator - The text operator to be used.public TextContainer(TextElement... elements)
elements - The elements to be added to the new text container.
public TextContainer(TextOperator textOperator,
TextElement... elements)
textOperator - The text operator to be used.elements - The elements to be added to the new text container.| Method Detail |
|---|
public int getTextElementsCount()
public TextElement getTextElement(int index)
index - The index of the text element to be returned.
public java.util.List<TextElement> getTextElements()
public void setTextElements(java.util.List<TextElement> elements)
elements - A list of text elements.public void addElement(TextElement el)
el - The text element to be added.public void removeAllElements()
public void removeLastElement()
public java.lang.String getText()
public void setTextOperator(TextOperator textOperator)
textOperator - The new text operator.public TextOperator getTextOperator()
public int getIndexOf(TextElement textElement)
textElement - The text element.
public TextContainer getSubTextContainer(int startPos,
int endPos)
startPos - The position of the first element.endPos - The position after the last element.
public TextContainer clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||