Search in sources :

Example 1 with IndicatorEnum

use of org.talend.dq.nodes.indicator.type.IndicatorEnum in project tdq-studio-se by Talend.

the class TableIndicator method createCategoryIndicatorUnits.

private TableIndicatorUnit[] createCategoryIndicatorUnits(IndicatorEnum[] indicatorEnums) {
    List<TableIndicatorUnit> indicatorUnitList = new ArrayList<TableIndicatorUnit>();
    TableIndicatorUnit indicatorUnit;
    for (IndicatorEnum indicatorEnum : indicatorEnums) {
        if (!IndicatorEnum.isPlainIndicatorEnum(indicatorEnum)) {
            continue;
        }
        indicatorUnit = getIndicatorUnit(indicatorEnum);
        indicatorUnitList.add(indicatorUnit);
    }
    return indicatorUnitList.toArray(new TableIndicatorUnit[indicatorUnitList.size()]);
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) ArrayList(java.util.ArrayList) TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit)

Example 2 with IndicatorEnum

use of org.talend.dq.nodes.indicator.type.IndicatorEnum in project tdq-studio-se by Talend.

the class TableIndicator method processIndicator.

private void processIndicator() {
    List<IndicatorEnum> enumList = new ArrayList<IndicatorEnum>();
    listCopy(enumList, indicatorEnumList);
    Iterator<IndicatorEnum> iterator = indicatorEnumList.iterator();
    List<IndicatorEnum> currentCountsChildren = new ArrayList<IndicatorEnum>();
    while (iterator.hasNext()) {
        IndicatorEnum indEnum = iterator.next();
        if (countsEnumChildren.contains(indEnum)) {
            currentCountsChildren.add(indEnum);
            continue;
        }
        if ((indEnum != IndicatorEnum.CountsIndicatorEnum) && indEnum.hasChildren()) {
            for (IndicatorEnum childrenEnum : indEnum.getChildren()) {
                enumList.remove(childrenEnum);
            }
        }
    }
    if (currentCountsChildren.size() == countsEnumChildren.size() && indicatorEnumList.contains(IndicatorEnum.CountsIndicatorEnum)) {
        enumList.removeAll(currentCountsChildren);
    } else {
        enumList.remove(IndicatorEnum.CountsIndicatorEnum);
    }
    indicatorUnits = createCategoryIndicatorUnits(enumList.toArray(new IndicatorEnum[enumList.size()]));
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) ArrayList(java.util.ArrayList)

Example 3 with IndicatorEnum

use of org.talend.dq.nodes.indicator.type.IndicatorEnum in project tdq-studio-se by Talend.

the class TableIndicator method setIndicators.

public void setIndicators(Indicator[] indicators) {
    this.clear();
    for (Indicator oneIndicator : indicators) {
        IndicatorEnum findIndicatorEnum = IndicatorEnum.findIndicatorEnum(oneIndicator.eClass());
        if (IndicatorEnum.isPlainIndicatorEnum(findIndicatorEnum)) {
            this.indicatorEnumList.add(findIndicatorEnum);
            createIndicatorUnit(findIndicatorEnum, oneIndicator);
        } else {
            this.addSpecialIndicator(findIndicatorEnum, oneIndicator);
        }
    }
    processIndicator();
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) Indicator(org.talend.dataquality.indicators.Indicator) RowCountIndicator(org.talend.dataquality.indicators.RowCountIndicator) WhereRuleIndicator(org.talend.dataquality.indicators.sql.WhereRuleIndicator)

Example 4 with IndicatorEnum

use of org.talend.dq.nodes.indicator.type.IndicatorEnum in project tdq-studio-se by Talend.

the class TableIndicator method storeTempIndicator.

public void storeTempIndicator() {
    for (IndicatorEnum indEnum : tempIndicatorEnums) {
        if (!indicatorEnumList.contains(indEnum)) {
            this.indicatorEnumList.add(indEnum);
        }
    }
    // remove the deleted IndicatorEnum from current indicatorsEnums;
    Iterator<IndicatorEnum> iterator = indicatorEnumList.iterator();
    while (iterator.hasNext()) {
        IndicatorEnum next = iterator.next();
        if (!tempIndicatorEnums.contains(next)) {
            iterator.remove();
        }
    }
    // clear tempIndicatorEnums
    tempIndicatorEnums.clear();
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum)

Example 5 with IndicatorEnum

use of org.talend.dq.nodes.indicator.type.IndicatorEnum in project tdq-studio-se by Talend.

the class ModelElementIndicatorImpl method processCategoryIndicator.

/**
 * Handle the category IndicatorEnum.
 */
private void processCategoryIndicator() {
    List<IndicatorEnum> categoryEnumList = new ArrayList<IndicatorEnum>();
    listCopy(categoryEnumList, flatIndicatorEnumList);
    Iterator<IndicatorEnum> iterator = flatIndicatorEnumList.iterator();
    List<IndicatorEnum> currentCountsChildren = new ArrayList<IndicatorEnum>();
    List<IndicatorEnum> currentBOXChildren = new ArrayList<IndicatorEnum>();
    // MOD qiongli 2012-4-25 TDQ-2699 consider TextIndicatorEnum.
    List<IndicatorEnum> currentTextChildren = new ArrayList<IndicatorEnum>();
    while (iterator.hasNext()) {
        IndicatorEnum indEnum = iterator.next();
        if (countsEnumChildren.contains(indEnum)) {
            currentCountsChildren.add(indEnum);
            continue;
        }
        if (boxEnumChildren.contains(indEnum)) {
            currentBOXChildren.add(indEnum);
        }
        if (textEnumChildren.contains(indEnum)) {
            currentTextChildren.add(indEnum);
        }
        if (null != indEnum && (indEnum != IndicatorEnum.CountsIndicatorEnum) && (indEnum != IndicatorEnum.BoxIIndicatorEnum) && indEnum != IndicatorEnum.TextIndicatorEnum && indEnum.hasChildren()) {
            for (IndicatorEnum childrenEnum : indEnum.getChildren()) {
                categoryEnumList.remove(childrenEnum);
            }
        }
    }
    if (currentCountsChildren.size() == countsEnumChildren.size() && flatIndicatorEnumList.contains(IndicatorEnum.CountsIndicatorEnum)) {
        categoryEnumList.removeAll(currentCountsChildren);
    } else {
        categoryEnumList.remove(IndicatorEnum.CountsIndicatorEnum);
    }
    if (currentBOXChildren.size() == boxEnumChildren.size() && flatIndicatorEnumList.contains(IndicatorEnum.BoxIIndicatorEnum)) {
        categoryEnumList.removeAll(currentBOXChildren);
    } else {
        categoryEnumList.remove(IndicatorEnum.BoxIIndicatorEnum);
    }
    if (currentTextChildren.size() == textEnumChildren.size() && flatIndicatorEnumList.contains(IndicatorEnum.TextIndicatorEnum)) {
        categoryEnumList.removeAll(currentTextChildren);
    } else {
        categoryEnumList.remove(IndicatorEnum.TextIndicatorEnum);
    }
    plainIndicatorUnits = createCategoryIndicatorUnits(categoryEnumList.toArray(new IndicatorEnum[categoryEnumList.size()]));
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) ArrayList(java.util.ArrayList)

Aggregations

IndicatorEnum (org.talend.dq.nodes.indicator.type.IndicatorEnum)33 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)10 IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)7 Indicator (org.talend.dataquality.indicators.Indicator)7 ArrayList (java.util.ArrayList)6 TableIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit)4 RangeIndicator (org.talend.dataquality.indicators.RangeIndicator)4 RowCountIndicator (org.talend.dataquality.indicators.RowCountIndicator)4 TalendGridItem (org.eclipse.nebula.widgets.grid.TalendGridItem)3 Point (org.eclipse.swt.graphics.Point)3 TreeItem (org.eclipse.swt.widgets.TreeItem)3 BoxIndicator (org.talend.dataquality.indicators.BoxIndicator)3 CountsIndicator (org.talend.dataquality.indicators.CountsIndicator)3 IQRIndicator (org.talend.dataquality.indicators.IQRIndicator)3 PhoneNumbStatisticsIndicator (org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator)3 IIndicatorNode (org.talend.dq.nodes.indicator.IIndicatorNode)3 IRepositoryNode (org.talend.repository.model.IRepositoryNode)3 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)2 MetadataXmlElementTypeRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataXmlElementTypeRepositoryObject)2