@@ -23,13 +23,16 @@ public final class BlockAnnotation implements Serializable {
2323 private final PresenceCondition presenceCondition ;
2424 private int lineStartInclusive ;
2525 private int lineEndInclusive ;
26+ private String nodeType ;
2627
2728 public BlockAnnotation (int lineStartInclusive , int lineEndInclusive ,
28- FeatureMapping featureMapping , PresenceCondition presenceCondition ) {
29+ FeatureMapping featureMapping , PresenceCondition presenceCondition ,
30+ String nodeType ) {
2931 this .lineStartInclusive = lineStartInclusive ;
3032 this .lineEndInclusive = lineEndInclusive ;
3133 this .featureMapping = featureMapping ;
3234 this .presenceCondition = presenceCondition ;
35+ this .nodeType = nodeType ;
3336 }
3437
3538 public void setLineStartInclusive (int lineStartInclusive ) {
@@ -48,6 +51,8 @@ public int lineEndExclusive() {
4851 return lineEndInclusive ;
4952 }
5053
54+ public String nodeType () {return nodeType ;}
55+
5156 @ Override
5257 public boolean equals (Object o ) {
5358 if (this == o ) return true ;
@@ -56,36 +61,41 @@ public boolean equals(Object o) {
5661 return lineStartInclusive == that .lineStartInclusive
5762 && lineEndInclusive == that .lineEndInclusive
5863 && Objects .equals (featureMapping , that .featureMapping )
59- && Objects .equals (presenceCondition , that .presenceCondition );
64+ && Objects .equals (presenceCondition , that .presenceCondition )
65+ && Objects .equals (nodeType , that .nodeType );
6066 }
6167
6268 @ Override
6369 public int hashCode () {
64- return Objects .hash (featureMapping , presenceCondition , lineStartInclusive , lineEndInclusive );
70+ return Objects .hash (featureMapping , presenceCondition , lineStartInclusive , lineEndInclusive , nodeType );
6571 }
6672
6773 public boolean annotationEquals (BlockAnnotation other ) {
6874 return this .featureMapping .equals (other .featureMapping )
69- && this .presenceCondition .equals (other .presenceCondition );
75+ && this .presenceCondition .equals (other .presenceCondition )
76+ && this .nodeType .equals (other .nodeType );
7077 }
7178
7279 public boolean annotationEquals (LineAnnotation other ) {
7380 return this .featureMapping .equals (other .featureMapping ())
74- && this .presenceCondition .equals (other .presenceCondition ());
81+ && this .presenceCondition .equals (other .presenceCondition ())
82+ && this .nodeType .equals (other .nodeType ());
7583 }
7684
7785 @ Override
7886 public String toString () {
7987 return "[" +
8088 "lineStartInclusive=" + lineStartInclusive + ", " +
8189 "lineEndExclusive=" + lineEndInclusive + ", " +
90+ "nodeType=" + nodeType + ", " +
8291 "featureMapping=" + featureMapping + ", " +
8392 "presenceCondition=" + presenceCondition + ']' ;
8493 }
8594
8695 public String asCSVLine () {
87- return "%s;%s;%d;%d" .formatted (normalizeCondition (this .featureMapping .mapping ()),
96+ return "%s;%s;%s;% d;%d" .formatted (normalizeCondition (this .featureMapping .mapping ()),
8897 normalizeCondition (this .presenceCondition .condition ()),
98+ this .nodeType ,
8999 this .lineStartInclusive ,
90100 this .lineEndInclusive );
91101 }
0 commit comments