@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.setNegated( false ); condition.setLeftValuename( "wibble_t" ); condition.setRightValuename( "wobble_s" ); condition.setFunction( org.pentaho.di.core.Condition.FUNC_EQUAL ); filterRowsMeta.setDefault();
setRightValuename( XMLHandler.getTagValue( condnode, "rightvalue" ) ); Node exactnode = XMLHandler.getSubNode( condnode, ValueMetaAndData.XML_TAG ); if ( exactnode != null ) {
condition.setLeftValuename( key ); condition.setFunction( Condition.getFunction( comparator ) ); condition.setRightValuename( field ); condition.setRightExact( new ValueMetaAndData( "value", value ) ); } else { subc.setRightValuename( field ); subc.setRightExact( new ValueMetaAndData( "value", value ) );
condition.setLeftValuename( r.getString( "LEFT_NAME", null ) ); condition.setFunction( Condition.getFunction( r.getString( "CONDITION_FUNCTION", null ) ) ); condition.setRightValuename( r.getString( "RIGHT_NAME", null ) );
active_condition.setRightValuename( null ); active_condition.setRightExact( null ); if ( selection != null ) { ValueMetaInterface v = fields.getValueMeta( esd.getSelectionNr() ); active_condition.setRightValuename( v.getName() ); active_condition.setRightExact( null ); setModified(); active_condition.setRightValuename( null ); active_condition.setRightExact( newval ); setModified();