Interface Group

  • All Known Subinterfaces:
    ProgramFragment, ProgramModule

    public interface Group
    The interface for groupings of code units that may have attributes such as names and comments.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean contains​(CodeUnit codeUnit)
      Returns whether this fragment contains the given code unit.
      java.lang.String getComment()
      Obtains the comment that has been associated with this fragment or module.
      java.lang.String getName()
      Obtains the name that has been associated with this fragment.
      int getNumParents()
      Obtains the number of parent's of this fragment.
      java.lang.String[] getParentNames()
      Returns the names of the modules which are parents to this fragment.
      ProgramModule[] getParents()
      Returns a list of the modules which are parents for this group.
      java.lang.String getTreeName()
      Returns the name of the tree that this group belongs to.
      void setComment​(java.lang.String comment)
      Sets the comment to associate with this fragment.
      void setName​(java.lang.String name)
      Sets the name of this fragment.
    • Method Detail

      • getComment

        java.lang.String getComment()
        Obtains the comment that has been associated with this fragment or module.
        Returns:
        may be null.
      • setComment

        void setComment​(java.lang.String comment)
        Sets the comment to associate with this fragment.
        Parameters:
        comment - the comment.
      • getName

        java.lang.String getName()
        Obtains the name that has been associated with this fragment. A fragment will always have a name and it will be unique within the set of all fragment and module names.
      • setName

        void setName​(java.lang.String name)
              throws DuplicateNameException
        Sets the name of this fragment.
        Parameters:
        name - the string to use for the fragment's name.
        Throws:
        DuplicateNameException - thrown if the name being set is already in use by another fragment or a module.
      • contains

        boolean contains​(CodeUnit codeUnit)
        Returns whether this fragment contains the given code unit.

        Parameters:
        codeUnit - the code unit being tested.
        Returns:
        true if the code unit is in the fragment, false otherwise.
      • getNumParents

        int getNumParents()
        Obtains the number of parent's of this fragment. If a fragment is in a module then the module is a parent of the fragment and the fragment is a child of the module. A fragment must have at least one parent and it may have multiple parents.
        Returns:
        the number of parents of this fragment.
      • getParents

        ProgramModule[] getParents()
        Returns a list of the modules which are parents for this group.
      • getParentNames

        java.lang.String[] getParentNames()
        Returns the names of the modules which are parents to this fragment.
      • getTreeName

        java.lang.String getTreeName()
        Returns the name of the tree that this group belongs to.