TextRange Class
A text range that specifies the position and length of a text fragment in a text run.
Declaration
public final class TextRange extends Struct<TextRange>
Inherited Members
Inheritance
Constructors
TextRange() Constructor
Initializes a new instance of the TextRange class.
Declaration
public TextRange()
TextRange(int start, int length) Constructor
Initializes a new instance of the TextRange class with specified settings.
Declaration
public TextRange(int start, int length)
Parameters
| Name | Type | Description |
|---|---|---|
| start | int | The zero-based index of the first character in the text range. |
| length | int | The number of characters in the text range. |
Methods
equals(Object obj) Method
Determines whether the specified object is equal to this text range.
Declaration
public boolean equals(Object obj)
Parameters
| Name | Type | Description |
|---|---|---|
| obj | Object | The object to compare with this text range. |
Returns
| Type | Description |
|---|---|
| boolean |
|
getLength() Method
Returns the length of a text range.
Declaration
public int getLength()
Returns
| Type | Description |
|---|---|
| int | The number of characters in the text range. |
getStart() Method
Returns the position of the first character in a text range.
Declaration
public int getStart()
Returns
| Type | Description |
|---|---|
| int | The zero-based index of the first character in the text range. |
hashCode() Method
Returns a hash code value for this text range.
Declaration
public int hashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code value for this text range. |