Class SymbolReference<S extends ResolvedDeclaration>


  • public class SymbolReference<S extends ResolvedDeclaration>
    extends Object
    A reference to a symbol. It can solved or not solved. If solved the corresponding declaration will be provided.
    Author:
    Federico Tomassetti
    • Method Detail

      • solved

        public static <S extends ResolvedDeclaration,​S2 extends S> SymbolReference<S> solved​(S2 symbolDeclaration)
        Create a solve reference to the given symbol.
      • unsolved

        public static <S extends ResolvedDeclarationSymbolReference<S> unsolved()
        Create a reference for an unsolved symbol.
        Type Parameters:
        S - The symbol reference type.
        Returns:
        The created unsolved symbol reference.
      • getDeclaration

        public Optional<S> getDeclaration()
        Get the declaration associated with the Symbol.
        Returns:
        an Optional with a present value if the symbol is solved, otherwise an empty Optional.
      • getCorrespondingDeclaration

        public S getCorrespondingDeclaration()
        The corresponding declaration. If not solve this throws UnsupportedOperationException.
      • isSolved

        public boolean isSolved()
        Is the reference solved?