Package org.apache.lucene.search.matchhighlight

## Class Passage

- java.lang.Object
- - org.apache.lucene.search.matchhighlight.OffsetRange
  - - org.apache.lucene.search.matchhighlight.Passage

- All Implemented Interfaces:
    `Cloneable`

      public class Passage
      extends OffsetRange

  A passage is a fragment of source text, scored and possibly with a list of sub-offsets (markers) to be highlighted. The markers can be overlapping or nested, but they're always contained within the passage.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `List<OffsetRange>` | `markers` |

    - ### Fields inherited from class org.apache.lucene.search.matchhighlight.OffsetRange

      `from, to`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Passage​(int from, int to, List<OffsetRange> markers)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `OffsetRange` | `slice​(int from, int to)` | Passages can't be sliced as it could split previously determined highlight markers.
    `String` | `toString()` |

    - ### Methods inherited from class org.apache.lucene.search.matchhighlight.OffsetRange

      `clone, contains, equals, hashCode, length`

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

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### markers

          public List<OffsetRange> markers

  - ### Constructor Detail

    - #### Passage

          public Passage​(int from,
                         int to,
                         List<OffsetRange> markers)

  - ### Method Detail

    - #### slice

          public OffsetRange slice​(int from,
                                   int to)

      Passages can't be sliced as it could split previously determined highlight markers.
      Overrides:
        `slice` in class `OffsetRange`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `OffsetRange`