Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class TextPosition

  1. Object
  2. TextPosition
A place between two characters of a paragraph: the caret position a point on a page maps to.

Fields

public final String paragraphIdThe paragraph’s id.
public final int offsetThe offset in the paragraph’s text, from zero to its length.

Constructors

public TextPosition(String paragraphId, int offset)Creates a position.

Methods

public boolean equals(Object o)Two positions are equal when they name the same offset of the same paragraph.
public int hashCode()A hash consistent with equals.
public String toString()The paragraph id and offset, for debugging.

Inherited methods

Field details

paragraphId

public final String paragraphId
The paragraph’s id.

offset

public final int offset
The offset in the paragraph’s text, from zero to its length.

Constructor details

TextPosition

public TextPosition(String paragraphId, int offset)
Creates a position.

Parameters

paragraphId String
the paragraph’s id
offset int
the offset in its text

Method details

equals

public boolean equals(Object o)
Two positions are equal when they name the same offset of the same paragraph.

Parameters

o Object
the other object

Returns

true when equal

hashCode

public int hashCode()
A hash consistent with equals.

Returns

the hash

toString

public String toString()
The paragraph id and offset, for debugging.

Returns

a description