Search in sources :

Example 21 with RangeRestriction

use of org.talend.dataquality.domain.RangeRestriction in project tdq-studio-se by Talend.

the class DomainHelper method createStringRangeRestriction.

public static RangeRestriction createStringRangeRestriction(String min, String max) {
    RangeRestriction rangeRestriction = DOMAIN.createRangeRestriction();
    rangeRestriction.setLowerValue(createStringValue(null, min));
    rangeRestriction.setUpperValue(createStringValue(null, max));
    return rangeRestriction;
}
Also used : RangeRestriction(org.talend.dataquality.domain.RangeRestriction)

Example 22 with RangeRestriction

use of org.talend.dataquality.domain.RangeRestriction in project tdq-studio-se by Talend.

the class DomainHelper method getMinBinValue.

/**
 * Method "getMinBinValue".
 *
 * @param domain
 * @return the lower value of the first bin.
 */
public static double getMinBinValue(Domain domain) {
    EList<RangeRestriction> ranges = domain.getRanges();
    if (ranges.isEmpty()) {
        // $NON-NLS-1$
        throw new IllegalArgumentException(Messages.getString("DomainHelper.NoRangeMin", domain.getName()));
    }
    RangeRestriction r1 = ranges.get(0);
    if (r1 == null) {
        // $NON-NLS-1$
        throw new IllegalArgumentException(Messages.getString("DomainHelper.FirstRangeMin", domain.getName()));
    }
    return getRealValue(r1.getLowerValue());
}
Also used : RangeRestriction(org.talend.dataquality.domain.RangeRestriction)

Aggregations

RangeRestriction (org.talend.dataquality.domain.RangeRestriction)22 Domain (org.talend.dataquality.domain.Domain)13 BooleanExpressionNode (org.talend.dataquality.expressions.BooleanExpressionNode)4 Expression (orgomg.cwm.objectmodel.core.Expression)3 ArrayList (java.util.ArrayList)1 List (java.util.List)1 EList (org.eclipse.emf.common.util.EList)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 TdColumn (org.talend.cwm.relational.TdColumn)1 AnalysisParameters (org.talend.dataquality.analysis.AnalysisParameters)1 DateGrain (org.talend.dataquality.indicators.DateGrain)1 DateParameters (org.talend.dataquality.indicators.DateParameters)1 IndicatorParameters (org.talend.dataquality.indicators.IndicatorParameters)1 IndicatorDefinition (org.talend.dataquality.indicators.definition.IndicatorDefinition)1 UDIndicatorDefinition (org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition)1