Search in sources :

Example 6 with IndicatorEnum

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

the class ModelElementIndicatorImpl method removeTempIndicatorEnum.

public void removeTempIndicatorEnum(IndicatorEnum indicatorEnum) {
    tempIndicatorEnums.remove(indicatorEnum);
    IndicatorEnum parentEnum = indicatorEnum.getParent();
    if (parentEnum != null && (parentEnum == IndicatorEnum.RangeIndicatorEnum || parentEnum == IndicatorEnum.IQRIndicatorEnum)) {
        tempIndicatorEnums.remove(parentEnum);
    }
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum)

Example 7 with IndicatorEnum

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

the class ModelElementIndicatorImpl method setIndicators.

// MOD klliu 2010-06-03 init Indicators of the gate
public void setIndicators(Indicator[] indicators) {
    clear();
    for (Indicator oneIndicator : indicators) {
        IndicatorEnum findIndicatorEnum = IndicatorEnum.findIndicatorEnum(oneIndicator.eClass());
        if (findIndicatorEnum == null) {
            // $NON-NLS-1$ //$NON-NLS-2$
            log.error("enum not found for indicator: " + oneIndicator.getName() + " of type " + oneIndicator.getClass());
            continue;
        }
        if (IndicatorEnum.isPlainIndicatorEnum(findIndicatorEnum)) {
            this.flatIndicatorEnumList.add(findIndicatorEnum);
            fillCategoryIndicators(findIndicatorEnum, oneIndicator);
        } else {
            this.addSpecialIndicator(findIndicatorEnum, oneIndicator);
        }
    }
    processCategoryIndicator();
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) UniqueCountIndicator(org.talend.dataquality.indicators.UniqueCountIndicator) AvgLengthWithBlankIndicator(org.talend.dataquality.indicators.AvgLengthWithBlankIndicator) FrequencyIndicator(org.talend.dataquality.indicators.FrequencyIndicator) MaxValueIndicator(org.talend.dataquality.indicators.MaxValueIndicator) MaxLengthWithBlankNullIndicator(org.talend.dataquality.indicators.MaxLengthWithBlankNullIndicator) ValidRegCodeCountIndicator(org.talend.dataquality.indicators.ValidRegCodeCountIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) AvgLengthWithBlankNullIndicator(org.talend.dataquality.indicators.AvgLengthWithBlankNullIndicator) MinLengthIndicator(org.talend.dataquality.indicators.MinLengthIndicator) MinValueIndicator(org.talend.dataquality.indicators.MinValueIndicator) LowerQuartileIndicator(org.talend.dataquality.indicators.LowerQuartileIndicator) AverageLengthIndicator(org.talend.dataquality.indicators.AverageLengthIndicator) MaxLengthWithBlankIndicator(org.talend.dataquality.indicators.MaxLengthWithBlankIndicator) MeanIndicator(org.talend.dataquality.indicators.MeanIndicator) DefValueCountIndicator(org.talend.dataquality.indicators.DefValueCountIndicator) WellFormE164PhoneCountIndicator(org.talend.dataquality.indicators.WellFormE164PhoneCountIndicator) RangeIndicator(org.talend.dataquality.indicators.RangeIndicator) AvgLengthWithNullIndicator(org.talend.dataquality.indicators.AvgLengthWithNullIndicator) MaxLengthWithNullIndicator(org.talend.dataquality.indicators.MaxLengthWithNullIndicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator) InvalidRegCodeCountIndicator(org.talend.dataquality.indicators.InvalidRegCodeCountIndicator) UpperQuartileIndicator(org.talend.dataquality.indicators.UpperQuartileIndicator) ValidPhoneCountIndicator(org.talend.dataquality.indicators.ValidPhoneCountIndicator) RowCountIndicator(org.talend.dataquality.indicators.RowCountIndicator) PossiblePhoneCountIndicator(org.talend.dataquality.indicators.PossiblePhoneCountIndicator) MaxLengthIndicator(org.talend.dataquality.indicators.MaxLengthIndicator) CountsIndicator(org.talend.dataquality.indicators.CountsIndicator) MinLengthWithBlankNullIndicator(org.talend.dataquality.indicators.MinLengthWithBlankNullIndicator) NullCountIndicator(org.talend.dataquality.indicators.NullCountIndicator) MedianIndicator(org.talend.dataquality.indicators.MedianIndicator) Indicator(org.talend.dataquality.indicators.Indicator) BlankCountIndicator(org.talend.dataquality.indicators.BlankCountIndicator) TextIndicator(org.talend.dataquality.indicators.TextIndicator) DistinctCountIndicator(org.talend.dataquality.indicators.DistinctCountIndicator) DuplicateCountIndicator(org.talend.dataquality.indicators.DuplicateCountIndicator) IQRIndicator(org.talend.dataquality.indicators.IQRIndicator) MinLengthWithBlankIndicator(org.talend.dataquality.indicators.MinLengthWithBlankIndicator) MinLengthWithNullIndicator(org.talend.dataquality.indicators.MinLengthWithNullIndicator) BoxIndicator(org.talend.dataquality.indicators.BoxIndicator)

Example 8 with IndicatorEnum

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

the class ModelElementIndicatorImpl method removeSpecialIndicatorUnit.

/**
 * Remove the specialIndicatorUnit from specialIndicatorList, if there exist more than one InicatorIndicator which
 * has same IndicatorEnumn type, the type of IndicatorUnit will be not removed from flatIndicatorEnumList.
 *
 * @param indicatorUnit
 */
private void removeSpecialIndicatorUnit(IndicatorUnit indicatorUnit) {
    IndicatorEnum indicatorEnumn = indicatorUnit.getType();
    this.specialIndicatorUnitList.remove(indicatorUnit);
    for (IndicatorUnit unit : specialIndicatorUnitList) {
        if (unit.getType() == indicatorEnumn) {
            return;
        } else {
            continue;
        }
    }
    this.flatIndicatorEnumList.remove(indicatorEnumn);
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit)

Example 9 with IndicatorEnum

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

the class ModelElementIndicatorImpl method fillCategoryIndicators.

/**
 * Fill the plain indicator value to the corresponding indicator's property, and fill the value to field
 * 'flatIndicatorEnumList' and 'plainIndicatorUnitMap'.
 *
 * @param indicatorEnum
 * @param indicator
 */
private void fillCategoryIndicators(IndicatorEnum indicatorEnum, Indicator indicator) {
    // add indicatorEnum to flatIndicatorEnumList
    if (indicatorEnum.hasChildren()) {
        for (IndicatorEnum indEnum : indicatorEnum.getChildren()) {
            if (this.flatIndicatorEnumList.contains(indEnum)) {
                continue;
            }
            this.flatIndicatorEnumList.add(indEnum);
        }
    }
    switch(indicatorEnum) {
        case CountsIndicatorEnum:
            CountsIndicator countsIndicator = (CountsIndicator) indicator;
            this.plainIndicatorUnitMap.put(IndicatorEnum.CountsIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.CountsIndicatorEnum, countsIndicator));
            // add indicatorUnit to indicatorUnitMap
            this.plainIndicatorUnitMap.put(IndicatorEnum.BlankCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.BlankCountIndicatorEnum, countsIndicator.getBlankCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.DistinctCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum, countsIndicator.getDistinctCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.DuplicateCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum, countsIndicator.getDuplicateCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.RowCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, countsIndicator.getRowCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.NullCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.NullCountIndicatorEnum, countsIndicator.getNullCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.UniqueIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum, countsIndicator.getUniqueCountIndicator()));
            // MOD klliu bug 13411 2010-06-03
            this.plainIndicatorUnitMap.put(IndicatorEnum.DefValueCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.DefValueCountIndicatorEnum, countsIndicator.getDefaultValueIndicator()));
            break;
        case TextIndicatorEnum:
            TextIndicator textIndicator = (TextIndicator) indicator;
            this.plainIndicatorUnitMap.put(IndicatorEnum.TextIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.TextIndicatorEnum, textIndicator));
            // add indicatorUnit to indicatorUnitMap
            this.plainIndicatorUnitMap.put(IndicatorEnum.MinLengthIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinLengthIndicatorEnum, textIndicator.getMinLengthIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MaxLengthIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxLengthIndicatorEnum, textIndicator.getMaxLengthIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.AverageLengthIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.AverageLengthIndicatorEnum, textIndicator.getAverageLengthIndicator()));
            // MOD mzhao
            this.plainIndicatorUnitMap.put(IndicatorEnum.MinLengthWithBlankIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinLengthWithBlankIndicatorEnum, textIndicator.getMinLengthWithBlankIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MinLengthWithBlankNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinLengthWithBlankNullIndicatorEnum, textIndicator.getMinLengthWithBlankNullIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MinLengthWithNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinLengthWithNullIndicatorEnum, textIndicator.getMinLengthWithNullIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MaxLengthWithBlankIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxLengthWithBlankIndicatorEnum, textIndicator.getMaxLengthWithBlankIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MaxLengthWithBlankNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxLengthWithBlankNullIndicatorEnum, textIndicator.getMaxLengthWithBlankNullIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MaxLengthWithNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxLengthWithNullIndicatorEnum, textIndicator.getMaxLengthWithNullIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.AverageLengthWithBlankIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.AverageLengthWithBlankIndicatorEnum, textIndicator.getAvgLengthWithBlankIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.AverageLengthWithNullBlankIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.AverageLengthWithNullBlankIndicatorEnum, textIndicator.getAvgLengthWithBlankNullIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.AverageLengthWithNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.AverageLengthWithNullIndicatorEnum, textIndicator.getAvgLengthWithNullIndicator()));
            break;
        case BoxIIndicatorEnum:
            BoxIndicator boxtIndicator = (BoxIndicator) indicator;
            this.plainIndicatorUnitMap.put(IndicatorEnum.BoxIIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.BoxIIndicatorEnum, boxtIndicator));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MeanIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MeanIndicatorEnum, boxtIndicator.getMeanIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MedianIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MedianIndicatorEnum, boxtIndicator.getMedianIndicator()));
            this.fillCategoryIndicators(IndicatorEnum.RangeIndicatorEnum, boxtIndicator.getRangeIndicator());
            this.fillCategoryIndicators(IndicatorEnum.IQRIndicatorEnum, boxtIndicator.getIQR());
            break;
        case IQRIndicatorEnum:
            IQRIndicator iqrIndicator = (IQRIndicator) indicator;
            this.plainIndicatorUnitMap.put(IndicatorEnum.IQRIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.IQRIndicatorEnum, iqrIndicator));
            this.plainIndicatorUnitMap.put(IndicatorEnum.LowerQuartileIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.LowerQuartileIndicatorEnum, iqrIndicator.getLowerValue()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.UpperQuartileIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.UpperQuartileIndicatorEnum, iqrIndicator.getUpperValue()));
            break;
        case RangeIndicatorEnum:
            RangeIndicator rangeIndicator = (RangeIndicator) indicator;
            this.plainIndicatorUnitMap.put(IndicatorEnum.RangeIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.RangeIndicatorEnum, rangeIndicator));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MaxValueIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxValueIndicatorEnum, rangeIndicator.getUpperValue()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.MinValueIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinValueIndicatorEnum, rangeIndicator.getLowerValue()));
            break;
        case PhoneNumbStatisticsIndicatorEnum:
            PhoneNumbStatisticsIndicator phoneNumbIndicator = (PhoneNumbStatisticsIndicator) indicator;
            this.plainIndicatorUnitMap.put(IndicatorEnum.PhoneNumbStatisticsIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.PhoneNumbStatisticsIndicatorEnum, phoneNumbIndicator));
            // add indicatorUnit to indicatorUnitMap
            this.plainIndicatorUnitMap.put(IndicatorEnum.ValidPhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.ValidPhoneCountIndicatorEnum, phoneNumbIndicator.getValidPhoneCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.PossiblePhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.PossiblePhoneCountIndicatorEnum, phoneNumbIndicator.getPossiblePhoneCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.ValidRegCodeCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.ValidRegCodeCountIndicatorEnum, phoneNumbIndicator.getValidRegCodeCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.InvalidRegCodeCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.InvalidRegCodeCountIndicatorEnum, phoneNumbIndicator.getInvalidRegCodeCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.WellFormE164PhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.WellFormE164PhoneCountIndicatorEnum, phoneNumbIndicator.getWellFormE164PhoneCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.WellFormIntePhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.WellFormIntePhoneCountIndicatorEnum, phoneNumbIndicator.getWellFormIntePhoneCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.WellFormNationalPhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.WellFormNationalPhoneCountIndicatorEnum, phoneNumbIndicator.getWellFormNationalPhoneCountIndicator()));
            this.plainIndicatorUnitMap.put(IndicatorEnum.FormatFreqPieIndictorEnum, createPlainIndicatorUnit(IndicatorEnum.FormatFreqPieIndictorEnum, phoneNumbIndicator.getFormatFreqPieIndicator()));
            break;
        default:
            this.plainIndicatorUnitMap.put(indicatorEnum, createPlainIndicatorUnit(indicatorEnum, indicator));
            break;
    }
}
Also used : BoxIndicator(org.talend.dataquality.indicators.BoxIndicator) TextIndicator(org.talend.dataquality.indicators.TextIndicator) IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) CountsIndicator(org.talend.dataquality.indicators.CountsIndicator) RangeIndicator(org.talend.dataquality.indicators.RangeIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) IQRIndicator(org.talend.dataquality.indicators.IQRIndicator)

Example 10 with IndicatorEnum

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

the class AnalysisColumnNominalIntervalTreeViewer method addTreeListener.

private void addTreeListener(final Tree tree) {
    tree.addFocusListener(new FocusListener() {

        public void focusGained(FocusEvent e) {
            if (e.getSource() instanceof Tree) {
                Tree currentTree = (Tree) e.getSource();
                if (currentTree.getSelection().length > 0) {
                    enabledButtons(true);
                }
            }
        }

        public void focusLost(FocusEvent e) {
            if (e.getSource() instanceof Tree) {
                Tree currentTree = (Tree) e.getSource();
                if (currentTree.getSelection().length <= 0) {
                    enabledButtons(false);
                }
            }
        }
    });
    tree.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean con = false;
            if (e.item instanceof TreeItem) {
                enabledButtons(true);
                TreeItem item = (TreeItem) e.item;
                if (item.getData(INDICATOR_UNIT_KEY) != null) {
                    IndicatorUnit indicatorUnit = (IndicatorUnit) item.getData(INDICATOR_UNIT_KEY);
                    IndicatorEnum type = indicatorUnit.getType();
                    con = IndicatorEnum.RegexpMatchingIndicatorEnum.compareTo(type) == 0 || IndicatorEnum.SqlPatternMatchingIndicatorEnum.compareTo(type) == 0;
                }
            }
            createTreeMenu(tree, con);
            showDetailView(tree);
        }
    });
    tree.addTreeListener(treeAdapter);
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) TreeItem(org.eclipse.swt.widgets.TreeItem) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) Tree(org.eclipse.swt.widgets.Tree) FocusListener(org.eclipse.swt.events.FocusListener) FocusEvent(org.eclipse.swt.events.FocusEvent)

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