Record Class ShortBasedSymbolOccurrence
java.lang.Object
java.lang.Record
com.github._1c_syntax.bsl.languageserver.references.model.ShortBasedSymbolOccurrence
- Record Components:
occurrenceType- Тип обращения к символу.symbol- Символ, к которому происходит обращение.uri- URI файла, в котором расположено обращение.startLineShort- Строка начала обращения.startCharacterShort- Столбец начала обращения.endLineShort- Строка конца обращения.endCharacterShort- Столбец конца обращения.
- All Implemented Interfaces:
SymbolOccurrence, Comparable<SymbolOccurrence>
public record ShortBasedSymbolOccurrence(OccurrenceType occurrenceType, Symbol symbol, URI uri, short startLineShort, short startCharacterShort, short endLineShort, short endCharacterShort)
extends Record
implements SymbolOccurrence
Компактная реализация
SymbolOccurrence с координатами диапазона в short.
Четыре short вместо четырёх int экономят 8 байт на экземпляр (40 → 32 байта
при сжатых указателях), что заметно на миллионах вхождений reference-индекса. Подходит для
файлов, где строки и столбцы укладываются в short (<= Short.MAX_VALUE);
выбор реализации делает фабрика SymbolOccurrence.of(OccurrenceType, Symbol, URI, Range).
Компоненты хранятся как short, но аксессоры startLine() и прочие расширяют их
до int по контракту SymbolOccurrence. Координаты неотрицательные, поэтому
расширение беззнаковой семантики не требует.
-
Field Summary
Fields inherited from interface SymbolOccurrence
COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionShortBasedSymbolOccurrence(OccurrenceType occurrenceType, Symbol symbol, URI uri, short startLineShort, short startCharacterShort, short endLineShort, short endCharacterShort) Creates an instance of aShortBasedSymbolOccurrencerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintshortReturns the value of theendCharacterShortrecord component.intendLine()shortReturns the value of theendLineShortrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoccurrenceTyperecord component.intshortReturns the value of thestartCharacterShortrecord component.intshortReturns the value of thestartLineShortrecord component.symbol()Returns the value of thesymbolrecord component.final StringtoString()Returns a string representation of this record class.uri()Returns the value of theurirecord component.Methods inherited from interface SymbolOccurrence
compareTo, range, startPosition
-
Constructor Details
-
ShortBasedSymbolOccurrence
public ShortBasedSymbolOccurrence(OccurrenceType occurrenceType, Symbol symbol, URI uri, short startLineShort, short startCharacterShort, short endLineShort, short endCharacterShort) Creates an instance of aShortBasedSymbolOccurrencerecord class.- Parameters:
occurrenceType- the value for theoccurrenceTyperecord componentsymbol- the value for thesymbolrecord componenturi- the value for theurirecord componentstartLineShort- the value for thestartLineShortrecord componentstartCharacterShort- the value for thestartCharacterShortrecord componentendLineShort- the value for theendLineShortrecord componentendCharacterShort- the value for theendCharacterShortrecord component
-
-
Method Details
-
startLine
public int startLine()- Specified by:
startLinein interfaceSymbolOccurrence- Returns:
- Строка начала обращения.
-
startCharacter
public int startCharacter()- Specified by:
startCharacterin interfaceSymbolOccurrence- Returns:
- Столбец начала обращения.
-
endLine
public int endLine()- Specified by:
endLinein interfaceSymbolOccurrence- Returns:
- Строка конца обращения.
-
endCharacter
public int endCharacter()- Specified by:
endCharacterin interfaceSymbolOccurrence- Returns:
- Столбец конца обращения.
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
occurrenceType
Returns the value of theoccurrenceTyperecord component.- Specified by:
occurrenceTypein interfaceSymbolOccurrence- Returns:
- the value of the
occurrenceTyperecord component
-
symbol
Returns the value of thesymbolrecord component.- Specified by:
symbolin interfaceSymbolOccurrence- Returns:
- the value of the
symbolrecord component
-
uri
Returns the value of theurirecord component.- Specified by:
uriin interfaceSymbolOccurrence- Returns:
- the value of the
urirecord component
-
startLineShort
public short startLineShort()Returns the value of thestartLineShortrecord component.- Returns:
- the value of the
startLineShortrecord component
-
startCharacterShort
public short startCharacterShort()Returns the value of thestartCharacterShortrecord component.- Returns:
- the value of the
startCharacterShortrecord component
-
endLineShort
public short endLineShort()Returns the value of theendLineShortrecord component.- Returns:
- the value of the
endLineShortrecord component
-
endCharacterShort
public short endCharacterShort()Returns the value of theendCharacterShortrecord component.- Returns:
- the value of the
endCharacterShortrecord component
-