Record Class IndexedPosition
java.lang.Object
java.lang.Record
com.google.errorprone.fixes.IndexedPosition
- All Implemented Interfaces:
ErrorPronePosition
public record IndexedPosition(int startPos, int endPos)
extends Record
implements ErrorPronePosition
Describes a position that only has a start and end index.
-
Constructor Summary
ConstructorsConstructorDescriptionIndexedPosition(int startPos, int endPos) Creates an instance of aIndexedPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintendPos()Returns the value of theendPosrecord component.final booleanIndicates whether some other object is "equal to" this one.intgetEndPosition(ErrorProneEndPosTable endPosTable) intgetEndPosition(com.sun.tools.javac.tree.EndPosTable endPosTable) intintcom.sun.tools.javac.tree.JCTreegetTree()final inthashCode()Returns a hash code value for this object.intstartPos()Returns the value of thestartPosrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IndexedPosition
public IndexedPosition(int startPos, int endPos) Creates an instance of aIndexedPositionrecord class.- Parameters:
startPos- the value for thestartPosrecord componentendPos- the value for theendPosrecord component
-
-
Method Details
-
getTree
public com.sun.tools.javac.tree.JCTree getTree()- Specified by:
getTreein interfaceErrorPronePosition
-
getStartPosition
public int getStartPosition()- Specified by:
getStartPositionin interfaceErrorPronePosition
-
getPreferredPosition
public int getPreferredPosition()- Specified by:
getPreferredPositionin interfaceErrorPronePosition
-
getEndPosition
- Specified by:
getEndPositionin interfaceErrorPronePosition
-
getEndPosition
public int getEndPosition(com.sun.tools.javac.tree.EndPosTable endPosTable) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
startPos
public int startPos()Returns the value of thestartPosrecord component.- Returns:
- the value of the
startPosrecord component
-
endPos
public int endPos()Returns the value of theendPosrecord component.- Returns:
- the value of the
endPosrecord component
-