Search in sources :

Example 1 with PhoneNumbStatisticsIndicator

use of org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator 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 2 with PhoneNumbStatisticsIndicator

use of org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator in project tdq-studio-se by Talend.

the class IndicatorSelectDialog method isMatchCurrentIndicator.

public boolean isMatchCurrentIndicator(ModelElementIndicator currentIndicator, IIndicatorNode indicatorNode) {
    boolean returnValueForCurrentIndicator = true;
    IIndicatorNode parentNode = indicatorNode.getParent();
    boolean isParentPhoneStatistics = parentNode != null && parentNode.getIndicatorInstance() != null && parentNode.getIndicatorInstance() instanceof PhoneNumbStatisticsIndicator;
    if (!ModelElementIndicatorRule.match(indicatorNode, currentIndicator, this.language)) {
        returnValueForCurrentIndicator = false;
    }
    Indicator indicatorInstance = indicatorNode.getIndicatorInstance();
    if (null != indicatorInstance && !(indicatorInstance instanceof DatePatternFreqIndicator) && null != indicatorInstance.getIndicatorDefinition() && indicatorInstance.getIndicatorDefinition().getSqlGenericExpression().size() < 1 && ExecutionLanguage.SQL.equals(language) && !UDIHelper.isJavaUDI(indicatorInstance) && !indicatorNode.hasChildren() && !(currentIndicator instanceof DelimitedFileIndicator) && !isParentPhoneStatistics) {
        returnValueForCurrentIndicator = false;
    }
    return returnValueForCurrentIndicator;
}
Also used : DatePatternFreqIndicator(org.talend.dataquality.indicators.DatePatternFreqIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) IIndicatorNode(org.talend.dq.nodes.indicator.IIndicatorNode) DatePatternFreqIndicator(org.talend.dataquality.indicators.DatePatternFreqIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) DelimitedFileIndicator(org.talend.dataprofiler.core.model.DelimitedFileIndicator) Indicator(org.talend.dataquality.indicators.Indicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator) DelimitedFileIndicator(org.talend.dataprofiler.core.model.DelimitedFileIndicator)

Example 3 with PhoneNumbStatisticsIndicator

use of org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator in project tdq-studio-se by Talend.

the class ModelElementIndicatorImpl method createCategoryIndicatorUnits.

/**
 * create indicatorMappings according category indicatorEnum.
 *
 * @param categoryEnums
 * @return
 */
private IndicatorUnit[] createCategoryIndicatorUnits(IndicatorEnum[] categoryEnums) {
    List<IndicatorUnit> indicatorUnitList = new ArrayList<IndicatorUnit>();
    IndicatorUnit indicatorUnit;
    for (IndicatorEnum categoryEnum : categoryEnums) {
        if (null == categoryEnum) {
            continue;
        }
        if (!IndicatorEnum.isPlainIndicatorEnum(categoryEnum)) {
            // tempSpecialIndicatorEnumList.add(categoryEnum);
            continue;
        }
        indicatorUnit = getPlainIndicatorUnit(categoryEnum);
        switch(categoryEnum) {
            case CountsIndicatorEnum:
                CountsIndicator countsIndicator = (CountsIndicator) indicatorUnit.getIndicator();
                countsIndicator.setBlankCountIndicator((BlankCountIndicator) getPlainIndicatorUnit(IndicatorEnum.BlankCountIndicatorEnum).getIndicator());
                countsIndicator.setDistinctCountIndicator((DistinctCountIndicator) getPlainIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum).getIndicator());
                countsIndicator.setDuplicateCountIndicator((DuplicateCountIndicator) getPlainIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum).getIndicator());
                countsIndicator.setRowCountIndicator((RowCountIndicator) getPlainIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum).getIndicator());
                countsIndicator.setNullCountIndicator((NullCountIndicator) getPlainIndicatorUnit(IndicatorEnum.NullCountIndicatorEnum).getIndicator());
                countsIndicator.setUniqueCountIndicator((UniqueCountIndicator) getPlainIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum).getIndicator());
                // MOD klliu bug 13411 2010-06-03
                countsIndicator.setDefaultValueIndicator((DefValueCountIndicator) getPlainIndicatorUnit(IndicatorEnum.DefValueCountIndicatorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.CountsIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case TextIndicatorEnum:
                TextIndicator textIndicator = (TextIndicator) indicatorUnit.getIndicator();
                textIndicator.setMinLengthIndicator((MinLengthIndicator) getPlainIndicatorUnit(IndicatorEnum.MinLengthIndicatorEnum).getIndicator());
                textIndicator.setMaxLengthIndicator((MaxLengthIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxLengthIndicatorEnum).getIndicator());
                textIndicator.setAverageLengthIndicator((AverageLengthIndicator) getPlainIndicatorUnit(IndicatorEnum.AverageLengthIndicatorEnum).getIndicator());
                // MOD yyi 2010-08-05
                textIndicator.setAvgLengthWithBlankIndicator((AvgLengthWithBlankIndicator) getPlainIndicatorUnit(IndicatorEnum.AverageLengthWithBlankIndicatorEnum).getIndicator());
                textIndicator.setAvgLengthWithNullIndicator((AvgLengthWithNullIndicator) getPlainIndicatorUnit(IndicatorEnum.AverageLengthWithNullIndicatorEnum).getIndicator());
                textIndicator.setAvgLengthWithBlankNullIndicator((AvgLengthWithBlankNullIndicator) getPlainIndicatorUnit(IndicatorEnum.AverageLengthWithNullBlankIndicatorEnum).getIndicator());
                textIndicator.setMinLengthWithBlankIndicator((MinLengthWithBlankIndicator) getPlainIndicatorUnit(IndicatorEnum.MinLengthWithBlankIndicatorEnum).getIndicator());
                textIndicator.setMinLengthWithNullIndicator((MinLengthWithNullIndicator) getPlainIndicatorUnit(IndicatorEnum.MinLengthWithNullIndicatorEnum).getIndicator());
                textIndicator.setMinLengthWithBlankNullIndicator((MinLengthWithBlankNullIndicator) getPlainIndicatorUnit(IndicatorEnum.MinLengthWithBlankNullIndicatorEnum).getIndicator());
                textIndicator.setMaxLengthWithBlankIndicator((MaxLengthWithBlankIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxLengthWithBlankIndicatorEnum).getIndicator());
                textIndicator.setMaxLengthWithNullIndicator((MaxLengthWithNullIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxLengthWithNullIndicatorEnum).getIndicator());
                textIndicator.setMaxLengthWithBlankNullIndicator((MaxLengthWithBlankNullIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxLengthWithBlankNullIndicatorEnum).getIndicator());
                // ~
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.TextIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case BoxIIndicatorEnum:
                BoxIndicator boxtIndicator = (BoxIndicator) indicatorUnit.getIndicator();
                boxtIndicator.setRangeIndicator((RangeIndicator) getPlainIndicatorUnit(IndicatorEnum.RangeIndicatorEnum).getIndicator());
                boxtIndicator.setIQR((IQRIndicator) getPlainIndicatorUnit(IndicatorEnum.IQRIndicatorEnum).getIndicator());
                boxtIndicator.setMeanIndicator((MeanIndicator) getPlainIndicatorUnit(IndicatorEnum.MeanIndicatorEnum).getIndicator());
                boxtIndicator.setMedianIndicator((MedianIndicator) getPlainIndicatorUnit(IndicatorEnum.MedianIndicatorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.BoxIIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case IQRIndicatorEnum:
                IQRIndicator iqrIndicator = (IQRIndicator) indicatorUnit.getIndicator();
                iqrIndicator.setLowerValue((LowerQuartileIndicator) getPlainIndicatorUnit(IndicatorEnum.LowerQuartileIndicatorEnum).getIndicator());
                iqrIndicator.setUpperValue((UpperQuartileIndicator) getPlainIndicatorUnit(IndicatorEnum.UpperQuartileIndicatorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.IQRIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case RangeIndicatorEnum:
                RangeIndicator rangeIndicator = (RangeIndicator) indicatorUnit.getIndicator();
                rangeIndicator.setLowerValue((MinValueIndicator) getPlainIndicatorUnit(IndicatorEnum.MinValueIndicatorEnum).getIndicator());
                rangeIndicator.setUpperValue((MaxValueIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxValueIndicatorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.RangeIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case PhoneNumbStatisticsIndicatorEnum:
                PhoneNumbStatisticsIndicator phoneNumbIndicator = (PhoneNumbStatisticsIndicator) indicatorUnit.getIndicator();
                phoneNumbIndicator.setValidPhoneCountIndicator((ValidPhoneCountIndicator) getPlainIndicatorUnit(IndicatorEnum.ValidPhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setPossiblePhoneCountIndicator((PossiblePhoneCountIndicator) getPlainIndicatorUnit(IndicatorEnum.PossiblePhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setValidRegCodeCountIndicator((ValidRegCodeCountIndicator) getPlainIndicatorUnit(IndicatorEnum.ValidRegCodeCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setInvalidRegCodeCountIndicator((InvalidRegCodeCountIndicator) getPlainIndicatorUnit(IndicatorEnum.InvalidRegCodeCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setWellFormE164PhoneCountIndicator((WellFormE164PhoneCountIndicator) getPlainIndicatorUnit(IndicatorEnum.WellFormE164PhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setWellFormIntePhoneCountIndicator((WellFormIntePhoneCountIndicatorImpl) getPlainIndicatorUnit(IndicatorEnum.WellFormIntePhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setWellFormNationalPhoneCountIndicator((WellFormNationalPhoneCountIndicatorImpl) getPlainIndicatorUnit(IndicatorEnum.WellFormNationalPhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setFormatFreqPieIndicator((FormatFreqPieIndicatorImpl) getPlainIndicatorUnit(IndicatorEnum.FormatFreqPieIndictorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.PhoneNumbStatisticsIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            default:
                indicatorUnitList.add(indicatorUnit);
                break;
        }
    }
    return indicatorUnitList.toArray(new IndicatorUnit[indicatorUnitList.size()]);
}
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) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit) ArrayList(java.util.ArrayList) IQRIndicator(org.talend.dataquality.indicators.IQRIndicator)

Example 4 with PhoneNumbStatisticsIndicator

use of org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator in project tdq-studio-se by Talend.

the class IndicatorHelper method propagateCountyCodeInChildren.

/**
 * DOC qiongli Comment method "propagateCountyCodeInChildren".
 *
 * @param indicator
 * @param countryCode
 */
public static void propagateCountyCodeInChildren(Indicator indicator, String countryCode) {
    if (IndicatorsPackage.eINSTANCE.getPhoneNumbStatisticsIndicator().equals(indicator.eClass())) {
        PhoneNumbStatisticsIndicator phoneIndicator = (PhoneNumbStatisticsIndicator) indicator;
        WellFormE164PhoneCountIndicator wellFormE164Indi = phoneIndicator.getWellFormE164PhoneCountIndicator();
        WellFormIntePhoneCountIndicator wellFormInteIndi = phoneIndicator.getWellFormIntePhoneCountIndicator();
        WellFormNationalPhoneCountIndicator wellFormNatiIndi = phoneIndicator.getWellFormNationalPhoneCountIndicator();
        ValidPhoneCountIndicator validPhoneIndi = phoneIndicator.getValidPhoneCountIndicator();
        PossiblePhoneCountIndicator possiblePhoneIndi = phoneIndicator.getPossiblePhoneCountIndicator();
        FormatFreqPieIndicator formatFreqPieIndicator = phoneIndicator.getFormatFreqPieIndicator();
        setCountryCodeParameter(wellFormE164Indi, countryCode);
        setCountryCodeParameter(wellFormInteIndi, countryCode);
        setCountryCodeParameter(wellFormNatiIndi, countryCode);
        setCountryCodeParameter(validPhoneIndi, countryCode);
        setCountryCodeParameter(possiblePhoneIndi, countryCode);
        setCountryCodeParameter(formatFreqPieIndicator, countryCode);
    }
    setCountryCodeParameter(indicator, countryCode);
}
Also used : WellFormIntePhoneCountIndicator(org.talend.dataquality.indicators.WellFormIntePhoneCountIndicator) ValidPhoneCountIndicator(org.talend.dataquality.indicators.ValidPhoneCountIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) FormatFreqPieIndicator(org.talend.dataquality.indicators.FormatFreqPieIndicator) WellFormNationalPhoneCountIndicator(org.talend.dataquality.indicators.WellFormNationalPhoneCountIndicator) WellFormE164PhoneCountIndicator(org.talend.dataquality.indicators.WellFormE164PhoneCountIndicator) PossiblePhoneCountIndicator(org.talend.dataquality.indicators.PossiblePhoneCountIndicator)

Aggregations

PhoneNumbStatisticsIndicator (org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator)4 BoxIndicator (org.talend.dataquality.indicators.BoxIndicator)2 CountsIndicator (org.talend.dataquality.indicators.CountsIndicator)2 IQRIndicator (org.talend.dataquality.indicators.IQRIndicator)2 RangeIndicator (org.talend.dataquality.indicators.RangeIndicator)2 TextIndicator (org.talend.dataquality.indicators.TextIndicator)2 IndicatorEnum (org.talend.dq.nodes.indicator.type.IndicatorEnum)2 ArrayList (java.util.ArrayList)1 DelimitedFileIndicator (org.talend.dataprofiler.core.model.DelimitedFileIndicator)1 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)1 ColumnIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit)1 IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)1 DatePatternFreqIndicator (org.talend.dataquality.indicators.DatePatternFreqIndicator)1 FormatFreqPieIndicator (org.talend.dataquality.indicators.FormatFreqPieIndicator)1 Indicator (org.talend.dataquality.indicators.Indicator)1 PossiblePhoneCountIndicator (org.talend.dataquality.indicators.PossiblePhoneCountIndicator)1 ValidPhoneCountIndicator (org.talend.dataquality.indicators.ValidPhoneCountIndicator)1 WellFormE164PhoneCountIndicator (org.talend.dataquality.indicators.WellFormE164PhoneCountIndicator)1 WellFormIntePhoneCountIndicator (org.talend.dataquality.indicators.WellFormIntePhoneCountIndicator)1 WellFormNationalPhoneCountIndicator (org.talend.dataquality.indicators.WellFormNationalPhoneCountIndicator)1