org.eml.MMAX2.api
Interface MarkableAPI

All Known Implementing Classes:
Markable

public interface MarkableAPI

This interface defines public methods for accessing Markable objects.


Method Summary
 java.lang.String getAttributeValue(java.lang.String attributeName, java.lang.String returnIfUndefined)
          (API) Returns the string value of this Markable's attribute, or returnIfUndefined if attribute is undefined for this Markable.
 java.lang.String getID()
          (API) Returns the ID string of this Markable, e.g.
 int getLeftmostDiscoursePosition()
          (API) Returns the discourse position of the leftmost MMAX2DiscourseElement that this Markable object contains.
 MarkableLevel getMarkableLevel()
          (API) Returns the MarkableLevel object that this Markable belongs to.
 int getRightmostDiscoursePosition()
          (API) Returns the discourse position of the rightmost MMAX2DiscourseElement that this Markable object contains.
 void setAttributeValue(java.lang.String attributeName, java.lang.String value)
          (API) Sets this markable's attribute to value.
 java.lang.String toString()
          (API) Returns the string representation of this Markable object.
 java.lang.String toTrimmedString(int maxWidth)
          (API) Returns the trimmed string representation of this Markable object.
 

Method Detail

getID

java.lang.String getID()
(API) Returns the ID string of this Markable, e.g. 'markable_12'.

Returns:
The ID of this Markable.

getAttributeValue

java.lang.String getAttributeValue(java.lang.String attributeName,
                                   java.lang.String returnIfUndefined)
(API) Returns the string value of this Markable's attribute, or returnIfUndefined if attribute is undefined for this Markable.

Parameters:
attributeName - The name of the attribute whose value to return.
returnIfUndefined - The string to return if attribute is undefined.
Returns:
The value of the attribute, or returnIfUndefined if attribute is undefined.

setAttributeValue

void setAttributeValue(java.lang.String attributeName,
                       java.lang.String value)
(API) Sets this markable's attribute to value.

Parameters:
attributeName - The attribute whose value to set.
value - The value to assign to the attribute.

getMarkableLevel

MarkableLevel getMarkableLevel()
(API) Returns the MarkableLevel object that this Markable belongs to.

Returns:
The MarkableLevel that this Markable belongs to.

toString

java.lang.String toString()
(API) Returns the string representation of this Markable object.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this Markable's text, including square brackets at fragment boundaries.

toTrimmedString

java.lang.String toTrimmedString(int maxWidth)
(API) Returns the trimmed string representation of this Markable object.

Parameters:
maxWidth - The maximum string width to return.
Returns:
The string representation of this Markable's text, including square brackets at fragment boundaries. The text is trimmed to contain maximally maxWidth characters. Trimming is performed by removing a part of the string in the middle and replacing it with [...].

getLeftmostDiscoursePosition

int getLeftmostDiscoursePosition()
(API) Returns the discourse position of the leftmost MMAX2DiscourseElement that this Markable object contains.

Returns:
The discourse position of the leftmost MMAX2DiscourseElement that this Markable object contains. The discourse position is normally the base data element's position in the base data file.

getRightmostDiscoursePosition

int getRightmostDiscoursePosition()
(API) Returns the discourse position of the rightmost MMAX2DiscourseElement that this Markable object contains.

Returns:
The discourse position of the rightmost MMAX2DiscourseElement that this Markable object contains. The discourse position is normally the base data element's position in the base data file.