net.sf.okapi.lib.xliff2.core

## Class AnnotatedSpan

- java.lang.Object
- - net.sf.okapi.lib.xliff2.core.AnnotatedSpan

-     public class AnnotatedSpan
      extends java.lang.Object

  Represents the information about a span of content that is associated with a marker (`MTag` object or a derived object).

  The span my exist across several parts (segments or ignorables).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotatedSpan(MTag marker, Part startPart, int start)` Creates a new `AnnotatedSpan` object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `append(java.lang.String chunk)` Appends a chunk of coded text to the coded text of this span.
    `java.lang.String` | `getCodedText()` Gets the coded text of the content for this span.
    `int` | `getEnd()` Gets the end position in the coded text of the end part of this span.
    `Part` | `getEndPart()` Gets the `Part` object where this span ends.
    `java.lang.String` | `getId()` Gets the id of the marker for this span.
    `MTag` | `getMarker()` Gets the `MTag` object associated with this span.
    `int` | `getPartCount()` Gets the number of parts where this span exists.
    `java.lang.String` | `getPlainText()` Gets the plain text version of the content for this span.
    `int` | `getStart()` Gets the start position in the coded text of the start part of this span.
    `Part` | `getStartPart()` Gets the `Part` object where this span starts.
    `java.lang.String` | `getType()` Gets the type of the marker for this span.
    `boolean` | `isFullContent()` Indicates if this span covers the entire content of the part or parts where it exists.
    `void` | `setEnd(int end)` Sets the end position in the coded text of the end part of this span.
    `void` | `setEndPart(Part endPart)` Sets the part/segment where this span ends.
    `void` | `setFullContent(boolean fullContent)` Sets the flag indicating if this span covers the entire content of the part or parts where it exists.
    `void` | `setPartCount(int partCount)` Sets the number of parts where this span exists.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AnnotatedSpan

          public AnnotatedSpan(MTag marker,
                       Part startPart,
                       int start)

      Creates a new `AnnotatedSpan` object.
      Parameters:
        `marker` - the marker associated to this span.
        `startPart` - the `Part` where this span starts.

  - ### Method Detail

    - #### getMarker

          public MTag getMarker()

      Gets the `MTag` object associated with this span.
      Returns:
        the annotation for this span.

    - #### getStartPart

          public Part getStartPart()

      Gets the `Part` object where this span starts.
      Returns:
        the part/segment where this span starts.

    - #### getEndPart

          public Part getEndPart()

      Gets the `Part` object 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 java.lang.String getType()

      Gets the type of the marker for this span.
      Returns:
        the marker type for this span.

    - #### getId

          public java.lang.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(java.lang.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 java.lang.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 java.lang.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).