Package org.opengrok.indexer.analysis
Class Definitions
java.lang.Object
org.opengrok.indexer.analysis.Definitions
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classClass that represents a single tag. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddTag(int line, String symbol, String type, String text, String namespace, String signature, int lineStart, int lineEnd) static Definitionsdeserialize(byte[] bytes) De-serialize a binary representation of aDefinitionsobject.Get all symbols used in definitions.getTags()Get a list of all tags.@Nullable List<Definitions.Tag> getTags(int line) Get a list of all tags on given line.booleanhasDefinitionAt(String symbol, int lineNumber, String[] strs) Check whether the specified symbol is defined on the given line.booleanCheck if there is a tag for a symbol.intReturn the number of distinct symbols.intoccurrences(String symbol) Return the number of occurrences of definitions with the specified symbol.voidReset allDefinitions.Tag.usedvalues tofalse.byte[]Create a binary representation of this object.
-
Constructor Details
-
Definitions
public Definitions()
-
-
Method Details
-
resetUnused
public void resetUnused()Reset allDefinitions.Tag.usedvalues tofalse. -
getSymbols
Get all symbols used in definitions.- Returns:
- a set containing all the symbols
-
hasSymbol
Check if there is a tag for a symbol.- Parameters:
symbol- the symbol to check- Returns:
trueif there is a tag forsymbol
-
hasDefinitionAt
Check whether the specified symbol is defined on the given line.- Parameters:
symbol- the symbol to look forlineNumber- the line to checkstrs- type of definition(to be passed back to caller)- Returns:
trueifsymbolis defined on the specified line
-
occurrences
Return the number of occurrences of definitions with the specified symbol.- Parameters:
symbol- the symbol to count the occurrences of- Returns:
- the number of times the specified symbol is defined
-
numberOfSymbols
public int numberOfSymbols()Return the number of distinct symbols.- Returns:
- number of distinct symbols
-
getTags
Get a list of all tags.- Returns:
- all tags
-
getTags
Get a list of all tags on given line.- Parameters:
line- line number- Returns:
- list of tags or null
-
addTag
-
addTag
-
serialize
Create a binary representation of this object.- Returns:
- a byte array representing this object
- Throws:
IOException- if an error happens when writing to the array
-
deserialize
De-serialize a binary representation of aDefinitionsobject.- Parameters:
bytes- a byte array containing theDefinitionsobject- Returns:
- a
Definitionsobject - Throws:
IOException- if an I/O error happens when reading the arrayClassNotFoundException- if the class definition for an object stored in the byte array cannot be foundClassCastException- if the array contains an object of another type thanDefinitions
-