Class ConceptAndSuperConceptsScope


  • public class ConceptAndSuperConceptsScope
    extends Scope
    • Constructor Detail

      • ConceptAndSuperConceptsScope

        public ConceptAndSuperConceptsScope​(@Nullable
                                            SNode topConcept)
    • Method Detail

      • resolve

        public SNode resolve​(SNode anchor,
                             String refText)
        Description copied from class: Scope
        Resolves element by reference text. Invariant: getReferenceText(contextNode, resolve(contextNode, refText)) == refText
        Specified by:
        resolve in class Scope
        Parameters:
        anchor - source node for the reference, or its nearest parent node (if source node is unavailable)
        refText - reference text
        Returns:
        resolved element when reference text unambiguously identifies element, null otherwise
      • getAvailableElements

        public Iterable<SNode> getAvailableElements​(@Nullable
                                                    String prefix)
        Description copied from class: Scope
        Returns all available elements in the scope.
        Specified by:
        getAvailableElements in class Scope
        Parameters:
        prefix - (if not null) filters out elements whose reference text doesn't start with prefix
        Returns:
        list of nodes in the scope
      • getReferenceText

        public String getReferenceText​(SNode anchor,
                                       SNode target)
        Description copied from class: Scope
        Creates textual reference for scope element. If element has no textual representation for the reference, returns null. Invariant: resolve(contextNode, getReferenceText(contextNode, node)) == node
        Specified by:
        getReferenceText in class Scope
        Parameters:
        anchor - source node for the reference, or its nearest parent node (if source node is unavailable)
        target - element from the current scope (contains(node) == true)
        Returns:
        reference text for the node element in the current scope