java.lang.Object
overit.geocallapp.utilities.ux.ui.container.gantt.data.GanttRow<R,B>
All Implemented Interfaces:
Serializable, Iterable<GanttBlock<B>>
Direct Known Subclasses:
DataCollectionTemplateGanttRow, GanttRowClustered, MultistageGroupGanttRow, ProjectGanttRow

public class GanttRow<R,B> extends Object implements Iterable<GanttBlock<B>>, Serializable
Define a Gantt row in a tree like structure. So, a GanttRow can have other GantRows as children and have a GanttRow as parent, with exception for the root GanttRow. A GanttRow collects also GanttBlocks that are the elements associated with this GanttRow
See Also:
  • Field Details

  • Constructor Details

    • GanttRow

      public GanttRow()
  • Method Details

    • isFake

      public boolean isFake()
      Used mainly for the root node, where the data doesn't have a natural root
      Returns:
      true if the row is fake (have no domain data associated); false otherwise
    • getId

      public String getId()
      Returns:
      the id of this row
    • setId

      public void setId(String id)
      Parameters:
      id - the id to set to this row
    • getDescription

      public String getDescription()
      Returns:
      the description to use as display info for this row
    • setDescription

      public void setDescription(String description)
      Parameters:
      description - to use as display info for this row
    • getBaseTooltipItems

      public Map<String,String> getBaseTooltipItems()
      Returns:
      a key, value map to use to build a tool-tip for this row. The keys will be used as labels (and translated if a '=' character is used as prefix)
    • setBaseTooltipItems

      public void setBaseTooltipItems(Map<String,String> baseTooltipItems)
      Parameters:
      baseTooltipItems - a key, value map to use to build a tool-tip for this row. The keys will be used as labels (and translated if a '=' character is used as prefix)
    • setParent

      public void setParent(GanttRow<R,B> parent)
      Parameters:
      parent - the GanttRow that is parent of this row
    • getParent

      public GanttRow<R,B> getParent()
      Returns:
      the GanttRow parent for this row. If null, this row is the root
    • addChildRow

      public void addChildRow(GanttRow<R,B> child)
      Parameters:
      child - add the given GanttRow as child of this row
    • getChildren

      public List<GanttRow<R,B>> getChildren()
      Returns:
      an Unmodifiable list with the GanttRows children of this row
    • setRawData

      public void setRawData(R rawData)
      Parameters:
      rawData - the domain data that holds this row
    • getRawData

      public R getRawData()
      Returns:
      the raw domain data that holds this row
    • addBlock

      public void addBlock(GanttBlock<B> block)
      Parameters:
      block - the GanttBlock to add to this row
    • getBlocks

      public Collection<GanttBlock<B>> getBlocks()
      Returns:
      an unmodifiable Collection with the GanttBlock of this row. The collection will respect the natural order of the blocks that is priority descending and begin date ascending
    • getLevel

      public int getLevel()
      Returns:
      the level of this row in the tree like structure of the Gantt rows
    • expandToIncludeBlocks

      public Date[] expandToIncludeBlocks(Date[] range)
      Parameters:
      range - a starting date range
      Returns:
      a range dates expanded to include all the blocks of the row
    • getPath

      public String getPath()
      Returns:
      a path composed by the id of the rows to traverse to reach this node starting from the root *
    • getByPath

      public GanttRow<R,B> getByPath(String path)
      Parameters:
      path - a path of row's id
      Returns:
      the node reached following the path starting from this
    • hasChildWithId

      public boolean hasChildWithId(String id)
      Parameters:
      id - the row's id to check
      Returns:
      true if this row have a child with the given id; false otherwise
    • getChild

      public GanttRow<R,B> getChild(String id)
      Parameters:
      id - the id of the child to retrieve
      Returns:
      the required child GanttRow if present.
      Throws:
      overit.geocall.asserts.AssertsException - if the given id belong to a GanttRow that is not child of this row
    • findRow

      public GanttRow<R,B> findRow(String id)
      Search in all the sub tree that starts with this row the required row
      Parameters:
      id - the id of the row to search
      Returns:
      the required GanttRow if belong to the sub tree; null otherwise
    • getBlock

      public GanttBlock<B> getBlock(String id)
      Parameters:
      id - the GanttBlock's to retrieve
      Returns:
      the required GanttBlock
      Throws:
      overit.geocall.asserts.AssertsException - if the given id belong to a GanttBlock that is not in this row
    • getBranchSize

      public int getBranchSize()
      Returns:
      the number of rows in the sub tree that starts with this node
    • countBlocks

      public int countBlocks()
      Returns:
      the number of blocks in this row
    • isLeaf

      public boolean isLeaf()
      Returns:
      true, if this row have no child rows; false otherwise
    • getIndicators

      public Map<String,List<GanttBlockIndicator>> getIndicators()
      Returns:
      the indicators configured for this row
    • addIndicator

      public void addIndicator(GanttBlockIndicator indicator)
      Parameters:
      indicator - the indicator to add
    • removeIndicator

      public void removeIndicator(GanttBlockIndicator indicator)
      Parameters:
      indicator - the indicator to remove
    • visit

      public void visit(GanttRowVisitConsumer<R,B> consumer)
      Implementation of a breadth first traversal over the tree. For each node, is passed as parameter to the consumer to do something during the visit.
      Parameters:
      consumer - GanttRowVisitConsumer to implement to do something during the tree visit
    • iterator

      public Iterator<GanttBlock<B>> iterator()
      Specified by:
      iterator in interface Iterable<R>