@Override public Condition getTestObject() { Condition rtn = new Condition(); rtn.setFunction( rand.nextInt( Condition.functions.length ) ); rtn.setLeftValuename( UUID.randomUUID().toString() ); rtn.setNegated( rand.nextBoolean() ); rtn.setOperator( rand.nextInt( Condition.operators.length ) ); rtn.setRightValuename( UUID.randomUUID().toString() ); return rtn; }
private boolean simplify( Condition condition, Condition parent ) { // If condition is atomic // AND // if parent only contain a single child: simplify // if ( condition.isAtomic() && parent.nrConditions() == 1 ) { parent.setLeftValuename( condition.getLeftValuename() ); parent.setFunction( condition.getFunction() ); parent.setRightValuename( condition.getRightValuename() ); parent.setRightExact( condition.getRightExact() ); parent.setNegated( condition.isNegated() ^ parent.isNegated() ); parent.list.clear(); return true; } return false; }
public void removeCondition( int nr ) { if ( isComposite() ) { Condition c = list.get( nr ); list.remove( nr ); // Nothing left or only one condition left: move it to the parent: make it atomic. boolean moveUp = isAtomic() || nrConditions() == 1; if ( nrConditions() == 1 ) { c = getCondition( 0 ); } if ( moveUp ) { setLeftValuename( c.getLeftValuename() ); setFunction( c.getFunction() ); setRightValuename( c.getRightValuename() ); setRightExact( c.getRightExact() ); setNegated( isNegated() ^ c.isNegated() ); } } }
Condition condition = new Condition(); condition.setNegated( false ); condition.setLeftValuename( "wibble_t" ); condition.setRightValuename( "wobble_s" ); condition.setFunction( org.pentaho.di.core.Condition.FUNC_EQUAL );
if ( nrconditions == 0 ) { setLeftValuename( XMLHandler.getTagValue( condnode, "leftvalue" ) ); setFunction( getFunction( XMLHandler.getTagValue( condnode, "function" ) ) ); setRightValuename( XMLHandler.getTagValue( condnode, "rightvalue" ) );
condition.setLeftValuename( key ); condition.setFunction( Condition.getFunction( comparator ) ); condition.setRightValuename( field ); subc.setOperator( Condition.OPERATOR_NONE ); subc.setLeftValuename( key ); subc.setFunction( Condition.getFunction( comparator ) ); subc.setRightValuename( field );
condition.setLeftValuename( r.getString( "LEFT_NAME", null ) ); condition.setFunction( Condition.getFunction( r.getString( "CONDITION_FUNCTION", null ) ) ); condition.setRightValuename( r.getString( "RIGHT_NAME", null ) );
if ( selection != null ) { ValueMetaInterface v = fields.getValueMeta( esd.getSelectionNr() ); active_condition.setLeftValuename( v.getName() ); setModified();
condition.setLeftValuename( __FORMULA_ + c ); condition.setOperator( convertOperator( constraint.orig.getCombinationType() ) ); condition.setFunction( Condition.FUNC_EQUAL ); condition.setLeftValuename( "__FORMULA2_" + c ); //$NON-NLS-1$ condition.setOperator( convertOperator( constraint.orig.getCombinationType() ) ); condition.setFunction( Condition.FUNC_EQUAL );