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

    Modifier and Type
    Method
    Description
    boolean
    contains(CodeUnit codeUnit)
    Returns whether this fragment contains the given code unit.
    Obtains the comment that has been associated with this fragment or module.
    Obtains the name that has been associated with this fragment.
    int
    Obtains the number of parent's of this fragment.
    Returns the names of the modules which are parents to this fragment.
    Returns a list of the modules which are parents for this group.
    Returns the name of the tree that this group belongs to.
    void
    setComment(String comment)
    Sets the comment to associate with this fragment.
    void
    Sets the name of this fragment.
  • Method Details

    • getComment

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

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

      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(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

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

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