diff --git a/LanguageServer/src/main/java/org/nittalab/dtram/languageserver/model/Token.java b/LanguageServer/src/main/java/org/nittalab/dtram/languageserver/model/Token.java index 1d69bad..567e722 100644 --- a/LanguageServer/src/main/java/org/nittalab/dtram/languageserver/model/Token.java +++ b/LanguageServer/src/main/java/org/nittalab/dtram/languageserver/model/Token.java @@ -17,12 +17,12 @@ /** * A position the token starts */ - private Position from; + private Position start; /** * A position the token ends */ - private Position to; + private Position end; /** * Indicates whether the token is the minimal block or not @@ -37,8 +37,8 @@ */ public Token() { this.text = ""; - this.from = new Position(0, 0); - this.to = new Position(0, 0); + this.start = new Position(0, 0); + this.end = new Position(0, 0); this.atomic = false; } @@ -46,16 +46,16 @@ * Constructs a new token with given properties. * * @param text - * @param from - * @param to + * @param start + * @param end * @param atomic * @author Shohei Yamagiwa * @since 0.1 */ - public Token(final String text, final Position from, final Position to, final boolean atomic) { + public Token(final String text, final Position start, final Position end, final boolean atomic) { this.text = text; - this.from = from; - this.to = to; + this.start = start; + this.end = end; this.atomic = atomic; } @@ -67,20 +67,20 @@ this.text = text; } - public Position getPositionFrom() { - return from; + public Position getStartPos() { + return start; } - public void setPositionFrom(Position from) { - this.from = from; + public void setStartPos(Position start) { + this.start = start; } - public Position getPositionTo() { - return to; + public Position getEndPos() { + return end; } - public void setPositionTo(Position to) { - this.to = to; + public void setEndPos(Position end) { + this.end = end; } public boolean isAtomic() { @@ -93,7 +93,7 @@ @Override public String toString() { - return text + " " + "starts from " + "line: " + from.getLine() + ", " + "column: " + from.getColumn() + " " + "to" + " " + "line: " + to.getLine() + ", " + "column: " + to.getColumn() + ", " + "isAtomic: " + atomic; + return text + " " + "starts from " + "line: " + start.getLine() + ", " + "column: " + start.getColumn() + " " + "to" + " " + "line: " + end.getLine() + ", " + "column: " + end.getColumn() + ", " + "isAtomic: " + atomic; } @Override @@ -102,11 +102,11 @@ return false; } Token other = (Token) o; - return Objects.equals(text, other.text) && Objects.equals(from, other.from) && Objects.equals(to, other.to) && Objects.equals(atomic, other.atomic); + return Objects.equals(text, other.text) && Objects.equals(start, other.start) && Objects.equals(end, other.end) && Objects.equals(atomic, other.atomic); } @Override public int hashCode() { - return Objects.hash(text, from, to, atomic); + return Objects.hash(text, start, end, atomic); } }