SelectionBoundary


public final class SelectionBoundary
extends Object implements Parcelable

java.lang.Object
   ↳ android.graphics.pdf.models.selection.SelectionBoundary


Represents one edge of the selected content.

Summary

Inherited constants

Fields

public static final Creator<SelectionBoundary> CREATOR

Public constructors

SelectionBoundary(int index)

Create a new instance of SelectionBoundary if index of boundary is known.

SelectionBoundary(Point point)

Create a new instance of SelectionBoundary if the boundary Point is known.

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

int getIndex()

Gets the index of the text as determined by the text stream processed.

boolean getIsRtl()

Gets whether the direction of selection is right-to-left (rtl) or reverse.

Point getPoint()

Gets the x, y coordinates of the selection boundary in points (1/72").

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

public static final Creator<SelectionBoundary> CREATOR

Public constructors

SelectionBoundary

public SelectionBoundary (int index)

Create a new instance of SelectionBoundary if index of boundary is known. The text returned by PdfPageTextContent#getText() form a "stream" and inside this "stream" each character has an index. Note: Point defaults to null in this case.

Parameters
index int: index of the selection boundary.

Throws
IllegalArgumentException If the index is negative.

SelectionBoundary

public SelectionBoundary (Point point)

Create a new instance of SelectionBoundary if the boundary Point is known. Index defaults to -1.

Parameters
point Point: The point of selection boundary. This value cannot be null.

Throws
NullPointerException If the point is null.

Public methods

describeContents

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getIndex

public int getIndex ()

Gets the index of the text as determined by the text stream processed. If the value is -1 then the getPoint() will determine the selection boundary.

Returns
int index of the selection boundary.

getIsRtl

public boolean getIsRtl ()

Gets whether the direction of selection is right-to-left (rtl) or reverse. The value of isRtl is determined by the underlying native layer using the start and stop boundaries.

Returns
boolean The direction of selection

getPoint

public Point getPoint ()

Gets the x, y coordinates of the selection boundary in points (1/72"). These coordinates are represented by a Point . If the value is null then the getIndex() will determine the selection boundary.

Note: Point (0,0) represents the top-left corner of the page

Returns
Point The point of the selection boundary.

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES