F - The type of file informationLexicalPositionType<F>public final class LexicalPosition<F> extends Object implements LexicalPositionType<F>
| Modifier and Type | Class | Description |
|---|---|---|
static class |
LexicalPosition.Builder<F> |
Builds instances of type
LexicalPosition. |
| Modifier and Type | Method | Description |
|---|---|---|
static <F> LexicalPosition.Builder<F> |
builder() |
Creates a builder for
LexicalPosition. |
int |
column() |
|
static <F> LexicalPosition<F> |
copyOf(LexicalPositionType<F> instance) |
Creates an immutable copy of a
LexicalPositionType value. |
boolean |
equals(Object another) |
This instance is equal to all instances of
LexicalPosition that have equal attribute values. |
Optional<F> |
file() |
|
int |
hashCode() |
Computes a hash code from attributes:
line, column, file. |
int |
line() |
|
static <F> LexicalPosition<F> |
of(int line,
int column,
Optional<? extends F> file) |
Construct a new immutable
LexicalPosition instance. |
String |
toString() |
Prints the immutable value
LexicalPosition with attribute values. |
LexicalPosition<F> |
withColumn(int value) |
Copy the current immutable object by setting a value for the
column attribute. |
LexicalPosition<F> |
withFile(F value) |
Copy the current immutable object by setting a present value for the optional
file attribute. |
LexicalPosition<F> |
withFile(Optional<? extends F> optional) |
Copy the current immutable object by setting an optional value for the
file attribute. |
LexicalPosition<F> |
withLine(int value) |
Copy the current immutable object by setting a value for the
line attribute. |
public int line()
line in interface LexicalPositionType<F>public int column()
column in interface LexicalPositionType<F>public Optional<F> file()
file in interface LexicalPositionType<F>public final LexicalPosition<F> withLine(int value)
line attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for linethis objectpublic final LexicalPosition<F> withColumn(int value)
column attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for columnthis objectpublic final LexicalPosition<F> withFile(F value)
file attribute.value - The value for filethis objectpublic final LexicalPosition<F> withFile(Optional<? extends F> optional)
file attribute.
A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.optional - A value for filethis objectpublic boolean equals(Object another)
LexicalPosition that have equal attribute values.public int hashCode()
line, column, file.public String toString()
LexicalPosition with attribute values.public static <F> LexicalPosition<F> of(int line, int column, Optional<? extends F> file)
LexicalPosition instance.line - The value for the line attributecolumn - The value for the column attributefile - The value for the file attributepublic static <F> LexicalPosition<F> copyOf(LexicalPositionType<F> instance)
LexicalPositionType value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.F - generic parameter Finstance - The instance to copypublic static <F> LexicalPosition.Builder<F> builder()
LexicalPosition.F - generic parameter FCopyright © 2017 <code@io7m.com> http://io7m.com