GraphTargetItem.src is readonly (field is private, getter added)

This commit is contained in:
honfika@gmail.com
2015-07-09 10:51:04 +02:00
parent 0437e95b4f
commit 42a8fc4c22
46 changed files with 167 additions and 152 deletions

View File

@@ -70,7 +70,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
public static final int NOPRECEDENCE = 16;
public GraphSourceItem src;
private GraphSourceItem src;
public int pos = -1;
@@ -118,6 +118,18 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
this.precedence = precedence;
}
public GraphSourceItem getSrc() {
return src;
}
protected HighlightData getSrcData() {
if (srcData == null) {
srcData = new HighlightData();
}
return srcData;
}
public List<GraphSourceItemPos> getNeededSources() {
List<GraphSourceItemPos> ret = new ArrayList<>();
ret.add(new GraphSourceItemPos(src, pos));
@@ -313,12 +325,4 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
public GraphTargetItem invert(GraphSourceItem src) {
return new NotItem(src, this);
}
protected HighlightData getSrcData() {
if (srcData == null) {
srcData = new HighlightData();
}
return srcData;
}
}