use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class SimpleRuleStatisticsChartState method getCustomerDataset.
public ICustomerDataset getCustomerDataset() {
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (TableIndicatorUnit unit : units) {
String value = CommonStateUtil.getUnitValue(unit.getValue(), StringFormatUtil.DOUBLE_NUMBER);
String label = unit.getIndicatorName();
// $NON-NLS-1$
customerdataset.addValue(Double.parseDouble(value), label, "");
ChartDataEntity entity = CommonStateUtil.createDataEntity(unit, value, label);
customerdataset.addDataEntity(entity);
}
return customerdataset;
}
use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class WhereRuleStatisticsStateTable method getCustomerXYDataset.
@Override
public ICustomerDataset getCustomerXYDataset() {
Map<Integer, Double> valueMap = new HashMap<Integer, Double>();
int x = 0;
for (TableIndicatorUnit unit : units) {
x++;
double y = 100 * (1 - (Double.parseDouble(unit.getValue().toString()) / getRowCount()));
valueMap.put(x, y);
}
final CustomerXYSeriesCollection dataset = new CustomerXYSeriesCollection(valueMap);
return dataset;
}
use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class WhereRuleStatisticsStateTable method getCustomerDatasetRownCount.
/**
* DOC xqliu Comment method "getCustomerDatasetRownCount".
*
* @return
*/
public ICustomerDataset getCustomerDatasetRownCount() {
CustomerDefaultCategoryDataset customerDataset = new CustomerDefaultCategoryDataset();
TableIndicatorUnit rownCountUnit = getRownCountUnit(units);
if (rownCountUnit != null) {
addRownCountDataEntity2CustomerDataset(customerDataset, rownCountUnit);
}
return customerDataset;
}
use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class WhereRuleStatisticsTableState method getDataEntity.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.editor.preview.model.states.table.AbstractTableTypeStates#getDataEntity()
*/
@Override
public ChartDataEntity[] getDataEntity() {
List<WhereRuleChartDataEntity> dataEnities = new ArrayList<WhereRuleChartDataEntity>();
for (TableIndicatorUnit unit : tableunits) {
if (IndicatorEnum.WhereRuleIndicatorEnum.equals(unit.getType())) {
double value = WhereRuleStatisticsStateUtil.getMatchValue(unit.getValue());
WhereRuleChartDataEntity entity = WhereRuleStatisticsStateUtil.createRuleDataEntity(unit, unit.getIndicatorName(), value, WhereRuleStatisticsStateUtil.getNotMatchValue(unit.getValue(), value, unit.geIndicatorCount()));
dataEnities.add(entity);
}
}
return dataEnities.toArray(new WhereRuleChartDataEntity[dataEnities.size()]);
}
use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class DQRuleUtilities method createIndicatorUnit.
/**
* DOC xqliu Comment method "createIndicatorUnit".
*
* @param fe
* @param tableIndicator
* @param analysis
* @return
*/
public static TableIndicatorUnit createIndicatorUnit(RuleRepNode ruleRepNode, TableIndicator tableIndicator, Analysis analysis) {
IndicatorDefinition whereRule = ruleRepNode.getRule();
for (Indicator indicator : tableIndicator.getIndicators()) {
if (whereRule.getName().equals(indicator.getName())) {
return null;
}
}
WhereRuleIndicator[] compositeWhereRuleIndicator = createCompositeWhereRuleIndicator(tableIndicator.getColumnSet(), whereRule);
IndicatorEnum type = IndicatorEnum.findIndicatorEnum(compositeWhereRuleIndicator[0].eClass());
TableIndicatorUnit addIndicatorUnit = tableIndicator.addSpecialIndicator(whereRule, type, compositeWhereRuleIndicator[0]);
DependenciesHandler.getInstance().setUsageDependencyOn(analysis, whereRule);
return addIndicatorUnit;
}
Aggregations