jmlparser-parent
Toggle table of contents
3.28.2-J8.0-K13.5-SNAPSHOT
java
Target filter
java
Switch theme
Search in API
Skip to content
jmlparser-parent
jmlparser-core
/
com.github.javaparser
/
Position
Position
open
class
Position
:
Comparable
<
Position
>
(
source
)
A position in a source file. Lines and columns start counting at 1.
Members
Constructors
Position
Link copied to clipboard
constructor
(
line
:
Int
,
column
:
Int
)
TODO: Do we refer to the characters as columns, ...or the spaces between (thus also before/after) characters as columns?
Properties
ABSOLUTE_
BEGIN_
LINE
Link copied to clipboard
val
ABSOLUTE_BEGIN_LINE
:
Int
=
-1
Line numbers must be positive, thus
ABSOLUTE_
END_
LINE
Link copied to clipboard
val
ABSOLUTE_END_LINE
:
Int
=
-2
column
Link copied to clipboard
val
column
:
Int
FIRST_
COLUMN
Link copied to clipboard
val
FIRST_COLUMN
:
Int
=
1
The first column -- note that it is 1-indexed (i.e.
FIRST_
LINE
Link copied to clipboard
val
FIRST_LINE
:
Int
=
1
The first line -- note that it is 1-indexed (i.e.
HOME
Link copied to clipboard
val
HOME
:
Position
The first position in the file.
line
Link copied to clipboard
val
line
:
Int
Functions
compare
To
Link copied to clipboard
open
fun
compareTo
(
otherPosition
:
Position
)
:
Int
equals
Link copied to clipboard
open
fun
equals
(
o
:
Any
)
:
Boolean
hash
Code
Link copied to clipboard
open
fun
hashCode
(
)
:
Int
invalid
Link copied to clipboard
open
fun
invalid
(
)
:
Boolean
is
After
Link copied to clipboard
open
fun
isAfter
(
otherPosition
:
Position
)
:
Boolean
is
After
Or
Equal
Link copied to clipboard
open
fun
isAfterOrEqual
(
otherPosition
:
Position
)
:
Boolean
is
Before
Link copied to clipboard
open
fun
isBefore
(
otherPosition
:
Position
)
:
Boolean
is
Before
Or
Equal
Link copied to clipboard
open
fun
isBeforeOrEqual
(
otherPosition
:
Position
)
:
Boolean
next
Line
Link copied to clipboard
open
fun
nextLine
(
)
:
Position
or
If
Invalid
Link copied to clipboard
open
fun
orIfInvalid
(
alternativePosition
:
Position
)
:
Position
pos
Link copied to clipboard
open
fun
pos
(
line
:
Int
,
column
:
Int
)
:
Position
Convenient factory method.
right
Link copied to clipboard
open
fun
right
(
characters
:
Int
)
:
Position
to
String
Link copied to clipboard
open
fun
toString
(
)
:
String
valid
Link copied to clipboard
open
fun
valid
(
)
:
Boolean
Check if the position is usable, also checks for special positions (ABSOLUTE_BEGIN_LINE and ABSOLUTE_END_LINE).
with
Column
Link copied to clipboard
open
fun
withColumn
(
column
:
Int
)
:
Position
with
Line
Link copied to clipboard
open
fun
withLine
(
line
:
Int
)
:
Position