-package org.simantics.ltk;\r
-\r
-\r
-public class Location {\r
- ISource source;\r
- int line;\r
- int beginPos;\r
- int endPos;\r
- \r
- public Location(ISource source, int line, int beginPos, int endPos) {\r
- this.source = source;\r
- this.line = line;\r
- this.beginPos = beginPos;\r
- this.endPos = endPos;\r
- }\r
- \r
- public Location(ISource source) {\r
- this(source, 0, 0, 0);\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return line + ":" + beginPos;\r
- }\r
- \r
- public ISource getSource() {\r
- return source;\r
- }\r
- \r
- public void setSource(ISource source) {\r
- this.source = source;\r
- }\r
- \r
- public int getLine() {\r
- return line + source.startLine();\r
- }\r
- \r
- public int getBeginPos() {\r
- return beginPos + source.startPos();\r
- }\r
- \r
- public int getEndPos() {\r
- return endPos + source.startPos();\r
- }\r
-}\r
+package org.simantics.ltk;
+
+
+public class Location {
+ ISource source;
+ int line;
+ int beginPos;
+ int endPos;
+
+ public Location(ISource source, int line, int beginPos, int endPos) {
+ this.source = source;
+ this.line = line;
+ this.beginPos = beginPos;
+ this.endPos = endPos;
+ }
+
+ public Location(ISource source) {
+ this(source, 0, 0, 0);
+ }
+
+ @Override
+ public String toString() {
+ return line + ":" + beginPos;
+ }
+
+ public ISource getSource() {
+ return source;
+ }
+
+ public void setSource(ISource source) {
+ this.source = source;
+ }
+
+ public int getLine() {
+ return line + source.startLine();
+ }
+
+ public int getBeginPos() {
+ return beginPos + source.startPos();
+ }
+
+ public int getEndPos() {
+ return endPos + source.startPos();
+ }
+}