]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.ltk/src/org/simantics/ltk/Location.java
Include Jaxen in org.simantics.scl.feature to keep JDom2 happy
[simantics/platform.git] / bundles / org.simantics.ltk / src / org / simantics / ltk / Location.java
1 package org.simantics.ltk;
2
3
4 public class Location {
5         ISource source;
6         int line;
7         int beginPos;
8         int endPos;
9         
10         public Location(ISource source, int line, int beginPos, int endPos) {
11                 this.source = source;
12                 this.line = line;
13                 this.beginPos = beginPos;
14                 this.endPos = endPos;
15         }
16         
17         public Location(ISource source) {
18                 this(source, 0, 0, 0);
19         }
20
21         @Override
22         public String toString() {
23                 return line + ":" + beginPos;
24         }
25         
26         public ISource getSource() {
27                 return source;
28         }
29         
30         public void setSource(ISource source) {
31                 this.source = source;
32         }
33         
34         public int getLine() {
35                 return line + source.startLine();
36         }
37         
38         public int getBeginPos() {
39                 return beginPos + source.startPos();
40         }
41         
42         public int getEndPos() {
43                 return endPos + source.startPos();
44         }
45 }