org.ucworkbench.model
Interface ITextModel

All Superinterfaces:
IRegion, IUCElement
All Known Subinterfaces:
IActor, IDescriptionSection, IExtension, IExtensionSection, IFileModel, IMainScenario, INumber, INumberable, INumberableScenarioable, INumberElement, IPropertiesSection, IProperty, IPropertyColonSeparator, IPropertyName, IPropertyValue, IReference, IScenario, IScenarioable, IScenarioItem, ISection, ISectionHeader, IStep, ISummarySection, IText, ITextable, ITextWithReferences, ITitleable, IUseCase, IUseCaseReference, IWhitespace

public interface ITextModel
extends IUCElement, IRegion

This is a base interface for all model objects that are fragments of text files. It provides functionality for computing localization in file, retrieving subelements with offset


Method Summary
 boolean containsOffset(int offset)
          Returns true if the object (or one of its children) contains the offset.
 java.lang.String getAsText()
          Returns the value of the element and all its children as concatenated text (in the form it is represented in file)
 IFileModel getCorrespondingFileModel()
          Returns the root IFileModel containing this element
 ITextModel getModelElementByOffset(int offset)
          Returns this element or one of the children depending on the offset.
 ITextModel getParent()
          Returns direct element containing this element.
 java.util.Collection<ITextModel> getTextModelChildren()
          Returns children as a list of
 
Methods inherited from interface org.ucworkbench.model.IUCElement
accept, childrenAccept, exists, getAncestor, getChildren, getCorrespondingResource, getElementName, getElementType, getPath, getUCProject, getUnderlyingResource
 
Methods inherited from interface org.ucworkbench.model.supporting.IRegion
getLength, getOffset
 

Method Detail

getParent

ITextModel getParent()
Returns direct element containing this element.

Specified by:
getParent in interface IUCElement
Returns:
the parent element, or null if this element has no parent

getAsText

java.lang.String getAsText()
Returns the value of the element and all its children as concatenated text (in the form it is represented in file)

Returns:
text

getCorrespondingFileModel

IFileModel getCorrespondingFileModel()
Returns the root IFileModel containing this element

Returns:

getModelElementByOffset

ITextModel getModelElementByOffset(int offset)
Returns this element or one of the children depending on the offset. The offset is computed globally for file, not locally for this element.

Parameters:
offset -
Returns:
null if the offset is out of range of this object

containsOffset

boolean containsOffset(int offset)
Returns true if the object (or one of its children) contains the offset. The offset is computed globally for file, not locally for this element.

Parameters:
offset -
Returns:

getTextModelChildren

java.util.Collection<ITextModel> getTextModelChildren()
Returns children as a list of

Returns:
See Also:
IUCElement.getChildren()