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