Class GanttDataBuilder<R,B>
java.lang.Object
overit.geocallapp.utilities.ux.ui.container.gantt.data.GanttDataBuilder<R,B>
- All Implemented Interfaces:
Serializable
Given a
DBView with the raw data
of some Gantt blocks and rows, this class will build
a tree of GanttRow.
To do this, use a given GanttDataReader that
have as assumption that the raw data must merge the
definition of the row and the blocks.
The result of the build process is a GanttRow that
must be intended as a tree root.
The children of this GanttRow are the actual rows generated
with the given data.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()protected GanttBlock<B> buildBlock(B rawData) First step of the build process.setClustered(boolean clustered) setRawData(DBView rawData) setReader(GanttDataReader<R, B> reader)
-
Constructor Details
-
GanttDataBuilder
public GanttDataBuilder()
-
-
Method Details
-
setClustered
- Parameters:
clustered- say if the generated Gantt row should take track of the block overlapping- Returns:
- an instance of this builder to chain the methods call
- See Also:
-
setReader
- Parameters:
reader- theGanttDataReaderto use to fill theGanttRows andGanttBlocks generated- Returns:
- an instance of this builder to chain the methods call
- Throws:
overit.geocall.asserts.AssertsException- if the given reader is null
-
setRawData
- Parameters:
rawData- theDBViewthat stores the data of rows and blocks. Assume that each record have the merged informations of both row and block.- Returns:
- an instance of this builder to chain the methods call
- Throws:
overit.geocall.asserts.AssertsException- if the given rawData is null
-
build
- Returns:
- the
GanttRowroot of the generated tree - Throws:
overit.geocall.asserts.AssertsException- if called before to configure the reader and the rawData
-
buildRows
First step of the build process. Generate the GanttRow and puts them in a Map. -
buildHierarchy
- Parameters:
flatRows- aMapwith the id string of theGanttRowas key, and the correspondingGanttRowas value.- Returns:
- a
GanttRowthat is the root of a tree like hierarchy, builded using theGanttDataReader.getParentRowId(R)method to identity the parent/children relation
-
buildBlock
- Parameters:
rawData- the block's rawData- Returns:
- a well configured
GanttBlock
-
buildRow
- Parameters:
rawData- the row's rawData- Returns:
- a well configured
GanttRow. Note that if the builder is configured to generate aGanttRowClustered, this method will return this kind ofGanttRow - See Also:
-