Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
New
Description
1) "vector.hasPositions() == false" in FieldTermStack's constructor
can be changed to "!vector.hasPositions()"
2) "public TermInfo(String, int, int, int, float)" constructor
can be change to "TermInfo(String, int, int, int, float)"
3) TermInfo's toString method
public String toString() { StringBuilder sb = new StringBuilder(); sb.append( text ).append( '(' ).append(startOffset).append ( ',' ).append( endOffset ).append( ',' ).append( position ).append( ')' ); return sb.toString(); }
This code can be changed to
public String toString(){ return text + '(' + startOffset + ',' + endOffset + ',' + position + ')'; }
this code.
4) TermInfo's equals method
public boolean equals(Object obj) { ... if (position != other.position) { return false; } return true; }
This code can be changed to
public boolean equals(Object obj) { ... return position == other.position; }