Interface TypeDeclaration

    • Method Detail

      • getBodyContainsOffset

        boolean getBodyContainsOffset​(int offs)
        Returns whether this type declaration contains the specified offset.
        Parameters:
        offs - The offset to check.
        Returns:
        Whether the offset is contained.
      • getBodyEndOffset

        int getBodyEndOffset()
        Returns the end-offset of the type declaration's body.
        Returns:
        The end offset.
        See Also:
        getBodyStartOffset()
      • getBodyStartOffset

        int getBodyStartOffset()
        Returns the start-offset of the type declaration's body.
        Returns:
        The start offset.
        See Also:
        getBodyEndOffset()
      • getChildType

        TypeDeclaration getChildType​(int index)
        Returns a child type by index.
        Parameters:
        index - The index.
        Returns:
        The child type.
        See Also:
        getChildTypeCount()
      • getChildTypeAtOffset

        TypeDeclaration getChildTypeAtOffset​(int offs)
        Returns the child type declaration of this one that contains the specified offset, if any.
        Parameters:
        offs - The offset.
        Returns:
        The type declaration, or null if the offset is outside any child type declaration.
      • getChildTypeCount

        int getChildTypeCount()
        Returns the number of child types.
        Returns:
        The number of child types.
        See Also:
        getChildType(int)
      • getDocComment

        java.lang.String getDocComment()
        Returns the doc comment for this type declaration.
        Returns:
        The doc comment.
        See Also:
        setDocComment(String)
      • getMemberCount

        int getMemberCount()
        Returns the number of members in this type declaration.
        Returns:
        The number of members.
        See Also:
        getMember(int), getMemberIterator()
      • getMemberIterator

        java.util.Iterator<Member> getMemberIterator()
        Returns an iterator over all members of this type. Note that an exception may be thrown if a method is added to this type while this iterator is being used.
        Returns:
        The iterator.
        See Also:
        getMethodIterator(), getMember(int), getMemberCount()
      • getMethodsByName

        java.util.List<Method> getMethodsByName​(java.lang.String name)
        Returns all methods declared in this type with the given name. Does not check for methods with this name in subclasses.
        Parameters:
        name - The name to check for.
        Returns:
        Any method overloads with that name, or an empty list if none.
      • getModifiers

        Modifiers getModifiers()
        Returns the modifiers of this type declaration.
        Returns:
        The modifier list. This may be null if no modifiers were specified.
      • getName

        java.lang.String getName()
        Returns the name of this type, unqualified.
        Specified by:
        getName in interface ASTNode
        Returns:
        The name of this type.
        See Also:
        getName(boolean)
      • getName

        java.lang.String getName​(boolean fullyQualified)
        Returns the name of this type.
        Parameters:
        fullyQualified - Whether the name returned should be fully qualified.
        Returns:
        The type's name.
        See Also:
        getName()
      • getPackage

        Package getPackage()
        Returns the package this type is in.
        Returns:
        The package, or null if it's in the default package.
      • getTypeString

        java.lang.String getTypeString()
        Returns the type of this type declaration, as a string.
        Returns:
        The type.
      • isDeprecated

        boolean isDeprecated()
        Returns whether this type declaration is deprecated.
        Returns:
        Whether this type declaration is deprecated.
      • isStatic

        boolean isStatic()
        Shortcut for getModifiers().isStatic(); useful since getModifiers() may return null.
        Returns:
        Whether this type declaration is static.
        See Also:
        getModifiers()
      • setDocComment

        void setDocComment​(java.lang.String comment)
        Sets the doc comment for this type declaration.
        Parameters:
        comment - The new doc comment.
        See Also:
        getDocComment()
      • setParentType

        void setParentType​(TypeDeclaration parentType)
        Sets the parent type declaration for this type declaration.
        Parameters:
        parentType - The parent type declaration.
        See Also:
        getParentType()