Class TranslationUnitDeclaration

    • Constructor Detail

      • TranslationUnitDeclaration

        public TranslationUnitDeclaration()
    • Method Detail

      • getDeclarationAs

        public <T extends Declaration> @Nullable T getDeclarationAs​(int i,
                                                                    java.lang.Class<T> clazz)
        Returns the i-th declaration as a specific class, if it can be cast
        Type Parameters:
        T - the type of the class
        Parameters:
        i - the index
        clazz - the class
        Returns:
        the declaration or null, if it the declaration can not be cast to the class
      • getDeclarationsByName

        public <T extends Declaration> @NonNull java.util.Set<T> getDeclarationsByName​(@NonNull java.lang.String name,
                                                                                       @NonNull java.lang.Class<T> clazz)
        Returns a non-null, possibly empty Set of the declaration of a specified type and clazz.

        The set may contain more than one element if a declaration exists in the TranslationUnitDeclaration itself and in an included header file.

        Type Parameters:
        T - the type of the declaration
        Parameters:
        name - the name to search for
        clazz - the declaration class, such as FunctionDeclaration.
        Returns:
        a Set containing the declarations, if any.
      • getIncludeByName

        public @Nullable IncludeDeclaration getIncludeByName​(@NonNull java.lang.String name)
      • getDeclarations

        public @NonNull java.util.List<Declaration> getDeclarations()
      • getDeclarationsPropertyEdge

        public @NonNull java.util.List<PropertyEdge<Declaration>> getDeclarationsPropertyEdge()
      • getNamespaces

        public @NonNull java.util.List<Declaration> getNamespaces()
      • getNamespacesPropertyEdge

        public @NonNull java.util.List<PropertyEdge<Declaration>> getNamespacesPropertyEdge()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class Node
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Node