use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class DataThresholdsForm method performFinish.
@Override
public boolean performFinish() {
String min = lowerText.getText();
String max = higherText.getText();
if ("".equals(min) && "".equals(max)) {
// $NON-NLS-1$ //$NON-NLS-2$
parameters.setDataValidDomain(null);
} else {
IndicatorHelper.setDataThreshold(parameters, min, max);
Indicator indicator = (Indicator) parameters.eContainer();
IndicatorHelper.propagateDataThresholdsInChildren(indicator);
}
return true;
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class PresentationParameterImpl method setIndicator.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIndicator(Indicator newIndicator) {
Indicator oldIndicator = indicator;
indicator = newIndicator;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportsPackage.PRESENTATION_PARAMETER__INDICATOR, oldIndicator, indicator));
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class MatchRuleAnlaysisUtils method getNeedIndicatorFromAna.
/**
* Get recording matching indicator and Blocking Indicator from analysis
*
* @param analysis
* @return the index 0 will be RecordMatchingIndicator and index 1 will be BlockKeyIndicator
*/
public static Object[] getNeedIndicatorFromAna(Analysis analysis) {
Object[] returnList = new Object[2];
EList<Indicator> indicators = analysis.getResults().getIndicators();
for (Indicator ind : indicators) {
if (ind instanceof RecordMatchingIndicator) {
returnList[0] = ind;
} else if (ind instanceof BlockKeyIndicator) {
returnList[1] = ind;
}
}
// If match rule definition is null, create a default.
if (returnList[0] == null) {
returnList[0] = ColumnsetPackage.eINSTANCE.getColumnsetFactory().createRecordMatchingIndicator();
}
// If blocking key indicator is nul, create a default.
if (returnList[1] == null) {
returnList[1] = ColumnsetPackage.eINSTANCE.getColumnsetFactory().createBlockKeyIndicator();
}
return returnList;
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class IndicatorHelper method propagateDataThresholdsInChildren.
/**
* Method "propagateDataThresholdsInChildren" will propage the data threshold to the indicator if the given
* indicator is a BoxIndicator (Otherwise, nothing is done).
*
* @param indicator an instance of BoxIndicator
*/
public static void propagateDataThresholdsInChildren(Indicator indicator) {
if (IndicatorsPackage.eINSTANCE.getBoxIndicator().equals(indicator.eClass())) {
BoxIndicator boxIndicator = (BoxIndicator) indicator;
String[] dataThreshold = IndicatorHelper.getDataThreshold(boxIndicator);
if (dataThreshold == null) {
// clear all data thresholds
final EList<Indicator> allChildIndicators = boxIndicator.getAllChildIndicators();
for (Indicator ind : allChildIndicators) {
clearDataThresholds(ind);
}
return;
}
// --- add thresholds in min and max indicators
RangeIndicator rangeIndicator = boxIndicator.getRangeIndicator();
setDataThresholds(rangeIndicator, dataThreshold);
// --- add thresholds in lower and upper quartile indicators
IQRIndicator iqr = boxIndicator.getIQR();
setDataThresholds(iqr, dataThreshold);
// --- add threholds to the mean and median indicator
setDataThreshold(boxIndicator.getMeanIndicator(), dataThreshold[0], dataThreshold[1]);
setDataThreshold(boxIndicator.getMedianIndicator(), dataThreshold[0], dataThreshold[1]);
} else if (IndicatorsPackage.eINSTANCE.getRangeIndicator().equals(indicator.eClass()) || IndicatorsPackage.eINSTANCE.getIQRIndicator().equals(indicator.eClass())) {
RangeIndicator rangeIndicator = (RangeIndicator) indicator;
String[] dataThreshold = IndicatorHelper.getDataThreshold(rangeIndicator);
if (dataThreshold == null) {
// clear all data thresholds
final EList<Indicator> allChildIndicators = rangeIndicator.getAllChildIndicators();
for (Indicator ind : allChildIndicators) {
clearDataThresholds(ind);
}
return;
}
// --- add thresholds in (min and max) or (lower and upper quartile) indicators
setDataThresholds(rangeIndicator, dataThreshold);
}
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class IndicatorHelper method getNullCountIndicator.
public static NullCountIndicator getNullCountIndicator(ModelElement modelElement, Map<ModelElement, List<Indicator>> elementToIndicator) {
List<Indicator> list = elementToIndicator.get(modelElement);
NullCountIndicator nullCountIndicator = null;
if (list == null) {
return nullCountIndicator;
}
for (Indicator indicator : list) {
if (IndicatorsPackage.eINSTANCE.getNullCountIndicator().equals(indicator.eClass())) {
nullCountIndicator = (NullCountIndicator) indicator;
}
}
return nullCountIndicator;
}
Aggregations