Package de.firemage.autograder.core
Record Class CodePosition
java.lang.Object
java.lang.Record
de.firemage.autograder.core.CodePosition
public record CodePosition(SourceInfo sourceInfo, SourcePath file, int startLine, int endLine, int startColumn, int endColumn)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionCodePosition(SourceInfo sourceInfo, SourcePath file, int startLine, int endLine, int startColumn, int endColumn) Creates an instance of aCodePositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theendColumnrecord component.intendLine()Returns the value of theendLinerecord component.final booleanIndicates whether some other object is "equal to" this one.file()Returns the value of thefilerecord component.static CodePositionfromSourcePosition(spoon.reflect.cu.SourcePosition sourcePosition, spoon.reflect.declaration.CtElement ctElement, SourceInfo sourceInfo) final inthashCode()Returns a hash code value for this object.Returns the value of thesourceInforecord component.intReturns the value of thestartColumnrecord component.intReturns the value of thestartLinerecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
CodePosition
public CodePosition(SourceInfo sourceInfo, SourcePath file, int startLine, int endLine, int startColumn, int endColumn) Creates an instance of aCodePositionrecord class.- Parameters:
sourceInfo- the value for thesourceInforecord componentfile- the value for thefilerecord componentstartLine- the value for thestartLinerecord componentendLine- the value for theendLinerecord componentstartColumn- the value for thestartColumnrecord componentendColumn- the value for theendColumnrecord component
-
-
Method Details
-
fromSourcePosition
public static CodePosition fromSourcePosition(spoon.reflect.cu.SourcePosition sourcePosition, spoon.reflect.declaration.CtElement ctElement, SourceInfo sourceInfo) -
readString
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
sourceInfo
Returns the value of thesourceInforecord component.- Returns:
- the value of the
sourceInforecord component
-
file
Returns the value of thefilerecord component.- Returns:
- the value of the
filerecord component
-
startLine
public int startLine()Returns the value of thestartLinerecord component.- Returns:
- the value of the
startLinerecord component
-
endLine
public int endLine()Returns the value of theendLinerecord component.- Returns:
- the value of the
endLinerecord component
-
startColumn
public int startColumn()Returns the value of thestartColumnrecord component.- Returns:
- the value of the
startColumnrecord component
-
endColumn
public int endColumn()Returns the value of theendColumnrecord component.- Returns:
- the value of the
endColumnrecord component
-