Package net.sf.okapi.lib.xliff2.core
Class AnnotatedSpan
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.core.AnnotatedSpan
-
-
Constructor Summary
Constructors Constructor Description AnnotatedSpan(MTag marker, Part startPart, int start)Creates a newAnnotatedSpanobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappend(String chunk)Appends a chunk of coded text to the coded text of this span.StringgetCodedText()Gets the coded text of the content for this span.intgetEnd()Gets the end position in the coded text of the end part of this span.PartgetEndPart()Gets thePartobject where this span ends.StringgetId()Gets the id of the marker for this span.MTaggetMarker()Gets theMTagobject associated with this span.intgetPartCount()Gets the number of parts where this span exists.StringgetPlainText()Gets the plain text version of the content for this span.intgetStart()Gets the start position in the coded text of the start part of this span.PartgetStartPart()Gets thePartobject where this span starts.StringgetType()Gets the type of the marker for this span.booleanisFullContent()Indicates if this span covers the entire content of the part or parts where it exists.voidsetEnd(int end)Sets the end position in the coded text of the end part of this span.voidsetEndPart(Part endPart)Sets the part/segment where this span ends.voidsetFullContent(boolean fullContent)Sets the flag indicating if this span covers the entire content of the part or parts where it exists.voidsetPartCount(int partCount)Sets the number of parts where this span exists.
-
-
-
Constructor Detail
-
AnnotatedSpan
public AnnotatedSpan(MTag marker, Part startPart, int start)
Creates a newAnnotatedSpanobject.- Parameters:
marker- the marker associated to this span.startPart- thePartwhere this span starts.start- the location where the part starts.
-
-
Method Detail
-
getMarker
public MTag getMarker()
Gets theMTagobject associated with this span.- Returns:
- the annotation for this span.
-
getStartPart
public Part getStartPart()
Gets thePartobject where this span starts.- Returns:
- the part/segment where this span starts.
-
getEndPart
public Part getEndPart()
Gets thePartobject where this span ends.- Returns:
- the part/segment where this span ends.
-
setEndPart
public void setEndPart(Part endPart)
Sets the part/segment where this span ends.- Parameters:
endPart- the part/segment where this span ends.
-
getType
public String getType()
Gets the type of the marker for this span.- Returns:
- the marker type for this span.
-
getId
public String getId()
Gets the id of the marker for this span.- Returns:
- the marker id for this span.
-
getStart
public int getStart()
Gets the start position in the coded text of the start part of this span.- Returns:
- the start position of this span.
- See Also:
getEnd(),getStartPart()
-
append
protected void append(String chunk)
Appends a chunk of coded text to the coded text of this span. (This used during the creation of the span).- Parameters:
chunk- the chunk to append.
-
getCodedText
public String getCodedText()
Gets the coded text of the content for this span.IMPORTANT: This coded text can go across parts (segments or ignorables).
- Returns:
- the coded text of the span (possibly across parts)
-
getPlainText
public String getPlainText()
Gets the plain text version of the content for this span.IMPORTANT: This text can go across parts (segments or ignorables).
- Returns:
- the plain text version of the content for this span.
-
setEnd
public void setEnd(int end)
Sets the end position in the coded text of the end part of this span.- Parameters:
end- the end position of this span.
-
getEnd
public int getEnd()
Gets the end position in the coded text of the end part of this span.- Returns:
- the end position of this span.
- See Also:
getStart(),getEndPart()
-
setPartCount
public void setPartCount(int partCount)
Sets the number of parts where this span exists.- Parameters:
partCount- the new number of parts where this span occurs.
-
getPartCount
public int getPartCount()
Gets the number of parts where this span exists.- Returns:
- the number of parts where this span exists.
-
setFullContent
public void setFullContent(boolean fullContent)
Sets the flag indicating if this span covers the entire content of the part or parts where it exists.- Parameters:
fullContent- true if the span content is the full content of the part(s).
-
isFullContent
public boolean isFullContent()
Indicates if this span covers the entire content of the part or parts where it exists.Note that annotation markers are not counted as part of the "content" in this context.
- Returns:
- true if this span is the full content of the part(s).
-
-