java.lang.Object
java.lang.Record
org.jhotdraw8.css.ast.SourceLocator
- Record Components:
characterOffset- the character offset or -1 if unknownlineNumber- the line number or -1 if unknown. A file starts with line number 1 (not with 0).uri- the source file URI or null if unknown
Indicates the position of a node in a source file, intended primarily for error reporting.
-
Constructor Summary
ConstructorsConstructorDescriptionSourceLocator(int characterOffset, int lineNumber, @Nullable URI uri) Creates an instance of aSourceLocatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecharacterOffsetrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thelineNumberrecord component.final StringtoString()Returns a string representation of this record class.@Nullable URIuri()Returns the value of theurirecord component.
-
Constructor Details
-
SourceLocator
Creates an instance of aSourceLocatorrecord class.- Parameters:
characterOffset- the value for thecharacterOffsetrecord componentlineNumber- the value for thelineNumberrecord componenturi- the value for theurirecord component
-
-
Method Details
-
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 '=='. -
characterOffset
public int characterOffset()Returns the value of thecharacterOffsetrecord component.- Returns:
- the value of the
characterOffsetrecord component
-
lineNumber
public int lineNumber()Returns the value of thelineNumberrecord component.- Returns:
- the value of the
lineNumberrecord component
-
uri
Returns the value of theurirecord component.- Returns:
- the value of the
urirecord component
-