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);
}
}
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();
}
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);
}
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;
}
}
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);
}
Aggregations