Interface IConsoleDocumentPartitionerExtension


public interface IConsoleDocumentPartitionerExtension
Extension interface for IConsoleDocumentPartitioner.

It adds more possibilities to query read-only regions of the partitioned document.

Since:
3.9
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns all partitions which are read-only.
    computeReadOnlyPartitions(int offset, int length)
    Returns all read-only partitions in given range.
    Returns all partitions which are writable.
    computeWritablePartitions(int offset, int length)
    Returns all writable partitions in given range.
    boolean
    containsReadOnly(int offset, int length)
    Returns whether this partitioner's document is read-only at any point in the specified range.
    int
    getNextOffsetByState(int offset, boolean searchWritable)
    Get this offset or the nearest offset after which is, depending on argument, writable or read-only.
    int
    getPreviousOffsetByState(int offset, boolean searchWritable)
    Get this offset or the nearest offset before which is, depending on argument, writable or read-only.
    boolean
    isReadOnly(int offset, int length)
    Returns whether this partitioner's document is read-only in the specified range.
  • Method Details

    • computeReadOnlyPartitions

      ITypedRegion[] computeReadOnlyPartitions()
      Returns all partitions which are read-only.
      Returns:
      all read-only partitions. Ordered by offset and never null.
    • computeReadOnlyPartitions

      ITypedRegion[] computeReadOnlyPartitions(int offset, int length)
      Returns all read-only partitions in given range.
      Parameters:
      offset - the offset of the range of interest
      length - the length of the range of interest
      Returns:
      read-only partitions in given range. Ordered by offset and never null. Returned regions may start and/or end outside given range.
    • computeWritablePartitions

      ITypedRegion[] computeWritablePartitions()
      Returns all partitions which are writable.
      Returns:
      all writable partitions. Ordered by offset and never null.
    • computeWritablePartitions

      ITypedRegion[] computeWritablePartitions(int offset, int length)
      Returns all writable partitions in given range.
      Parameters:
      offset - the offset of the range of interest
      length - the length of the range of interest
      Returns:
      writable partitions in given range. Ordered by offset and never null. Returned regions may start and/or end outside given range.
    • isReadOnly

      boolean isReadOnly(int offset, int length)
      Returns whether this partitioner's document is read-only in the specified range. Only returns true if the whole range is read-only.
      Parameters:
      offset - document offset
      length - range length
      Returns:
      whether this partitioner's document is read-only in the specific range
    • containsReadOnly

      boolean containsReadOnly(int offset, int length)
      Returns whether this partitioner's document is read-only at any point in the specified range.
      Parameters:
      offset - document offset
      length - range length
      Returns:
      returns true if any offset in the given range is read-only
    • getPreviousOffsetByState

      int getPreviousOffsetByState(int offset, boolean searchWritable)
      Get this offset or the nearest offset before which is, depending on argument, writable or read-only.
      Parameters:
      offset - the offset of interest
      searchWritable - if true return the nearest writable offset. If false return the nearest read-only offset.
      Returns:
      the given offset if it has the requested read-only/writable state or the nearest offset before with requested state. Returns -1 if there is no offset with requested state before requested offset.
    • getNextOffsetByState

      int getNextOffsetByState(int offset, boolean searchWritable)
      Get this offset or the nearest offset after which is, depending on argument, writable or read-only.
      Parameters:
      offset - the offset of interest
      searchWritable - if true return the nearest writable offset. If false return the nearest read-only offset.
      Returns:
      the given offset if it has the requested read-only/writable state or the nearest offset after with requested state. Returns the document length if there is no offset with requested state after requested offset.