Class CCAbstractTreeItem

java.lang.Object
com.ibm.debug.pdt.codecoverage.core.results.CCAbstractItem
com.ibm.debug.pdt.codecoverage.core.results.CCAbstractTreeItem
All Implemented Interfaces:
ICCBase, ICCTreeItem
Direct Known Subclasses:
CCEmptyResult

public abstract class CCAbstractTreeItem extends CCAbstractItem implements ICCTreeItem
Base implementation of a CC item that is part of a tree hierarchy
Since:
4.0
  • Field Details

  • Method Details

    • getResult

      public ICCResult getResult()
      Returns:
      the result
      Since:
      9.0
    • getParent

      public ICCTreeItem getParent()
      Description copied from interface: ICCTreeItem
      Returns the parent or null if it is a root item
      Specified by:
      getParent in interface ICCTreeItem
      Returns:
      parent or null
    • setParent

      public void setParent(ICCTreeItem parent)
      Description copied from interface: ICCTreeItem
      Sets the parent of this item This item will become a child of the parent
      Specified by:
      setParent in interface ICCTreeItem
      Parameters:
      parent - this artifact's parent
    • isRoot

      public boolean isRoot()
      Description copied from interface: ICCTreeItem
      Returns true if this is a root item with no parent
      Specified by:
      isRoot in interface ICCTreeItem
      Returns:
      true if it has no parent and therefore is a root item
    • getChildren

      public ICCTreeItem[] getChildren()
      Description copied from interface: ICCTreeItem
      Returns an array (could be an empty array) of children New in v9 calls to this method will return child items in an order as determined by the items themselves
      Specified by:
      getChildren in interface ICCTreeItem
      Returns:
      array of children or an empty array
    • getChildren

      public <T extends ICCTreeItem> T[] getChildren(T[] array)
      Helper method to get array of items on the requested type
      Type Parameters:
      T - type or return array
      Parameters:
      array - pre-allocated array of the type required
      Returns:
      an array of children of type T
      Since:
      6.0
    • addChild

      public boolean addChild(ICCTreeItem child)
      Description copied from interface: ICCTreeItem
      Add a single child to this item The added child will have this item as its parent
      Specified by:
      addChild in interface ICCTreeItem
      Parameters:
      child - child to be added
      Returns:
      true if added
    • addChildren

      public void addChildren(ICCTreeItem[] children)
      Description copied from interface: ICCTreeItem
      Add array of children to this item The added children will have this item as their parent if it is important to know if an item already exists then use ICCTreeItem.addChild(ICCTreeItem)
      Specified by:
      addChildren in interface ICCTreeItem
      Parameters:
      children - array of children to be added
    • getChild

      public ICCTreeItem getChild(String name)
      Description copied from interface: ICCTreeItem
      Given a name return the matching child The current implementation only supports unique names
      Specified by:
      getChild in interface ICCTreeItem
      Parameters:
      name - child's name to retrieve
      Returns:
      null or the child
    • getNumChildren

      public int getNumChildren()
      Description copied from interface: ICCTreeItem
      Returns the number of children
      Specified by:
      getNumChildren in interface ICCTreeItem
      Returns:
      number of children
    • getQualifiedName

      public String getQualifiedName()
      Description copied from interface: ICCTreeItem
      Returns a qualified name can be used to uniquely identify an object.
      Specified by:
      getQualifiedName in interface ICCTreeItem
      Returns:
      qualified name
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • refresh

      public void refresh()
      Description copied from interface: ICCTreeItem
      Refreshes the children to ensure the sort order is correct
      Specified by:
      refresh in interface ICCTreeItem
    • getUUID

      public final String getUUID()
      Description copied from interface: ICCTreeItem
      Returns a globally unique id (UUID) If one does not exist in the result, a call to ICCTreeItem.getUniqueID() will be done to produce a unique reproducible string
      Specified by:
      getUUID in interface ICCTreeItem
      Returns:
      UUID or null
    • setUUID

      public void setUUID(String uniqueID)
      Description copied from interface: ICCTreeItem
      Sets the unique id for this tree item When possible this should be a UUID format.
      Specified by:
      setUUID in interface ICCTreeItem
      Parameters:
      uniqueID - UUID or a globally unique identifier
    • setChildName

      public void setChildName(ICCTreeItem child, String oldName, String newName)
      Helper method to update any internal references to a child's name that may require update when a child's name is changed. This is not part of the interface
      Parameters:
      child - that will be renamed
      oldName - current name
      newName - new name
    • setName

      public void setName(String name)
      Description copied from class: CCAbstractItem
      Set the name of this artifact In version 10.1 this became part of the API
      Specified by:
      setName in interface ICCBase
      Overrides:
      setName in class CCAbstractItem
      Parameters:
      name - new name for this artifact