if ( show_operator && getOperator() != OPERATOR_NONE ) { retval += getOperatorDesc() + " "; } else { if ( getOperator() != OPERATOR_NONE && ( show_operator || level > 0 ) ) { for ( int i = 0; i < level; i++ ) { retval += " ";
public void addCondition( Condition cb ) { if ( isAtomic() && getLeftValuename() != null ) { /* * Copy current atomic setup... */ Condition current = new Condition( getLeftValuename(), getFunction(), getRightValuename(), getRightExact() ); current.setNegated( isNegated() ); setNegated( false ); list.add( current ); } else { // Set default operator if not on first position... if ( isComposite() && list.size() > 0 && cb.getOperator() == OPERATOR_NONE ) { cb.setOperator( OPERATOR_AND ); } } list.add( cb ); }
public String getXML( int level ) throws KettleValueException { String retval = ""; String indent1 = Const.rightPad( " ", level ); String indent2 = Const.rightPad( " ", level + 1 ); String indent3 = Const.rightPad( " ", level + 2 ); retval += indent1 + XMLHandler.openTag( XML_TAG ) + Const.CR; retval += indent2 + XMLHandler.addTagValue( "negated", isNegated() ); if ( getOperator() != OPERATOR_NONE ) { retval += indent2 + XMLHandler.addTagValue( "operator", Const.rtrim( getOperatorDesc() ) ); } if ( isAtomic() ) { retval += indent2 + XMLHandler.addTagValue( "leftvalue", getLeftValuename() ); retval += indent2 + XMLHandler.addTagValue( "function", getFunctionDesc() ); retval += indent2 + XMLHandler.addTagValue( "rightvalue", getRightValuename() ); if ( getRightExact() != null ) { retval += indent2 + getRightExact().getXML(); } } else { retval += indent2 + "<conditions>" + Const.CR; for ( int i = 0; i < nrConditions(); i++ ) { Condition c = getCondition( i ); retval += c.getXML( level + 2 ); } retval += indent3 + "</conditions>" + Const.CR; } retval += indent2 + XMLHandler.closeTag( XML_TAG ) + Const.CR; return retval; }
@Override public void widgetSelected( SelectionEvent e ) { // Move the condition lower: this means create a subcondition and put the condition there in the list. // Condition down = active_condition.getCondition( cond_nr ); Condition c = new Condition(); c.setOperator( down.getOperator() ); down.setOperator( Condition.OPERATOR_NONE ); active_condition.setCondition( cond_nr, c ); c.addCondition( down ); widget.redraw(); } } );
String selection = esd.open( defnr ); if ( selection != null ) { int opnr = Condition.getOperator( selection ); active_condition.getCondition( operator ).setOperator( opnr ); setModified();
public void addCondition( int idx, Condition cb ) { if ( isAtomic() && getLeftValuename() != null ) { /* * Copy current atomic setup... */ Condition current = new Condition( getLeftValuename(), getFunction(), getRightValuename(), getRightExact() ); current.setNegated( isNegated() ); setNegated( false ); list.add( current ); } else { // Set default operator if not on first position... if ( isComposite() && idx > 0 && cb.getOperator() == OPERATOR_NONE ) { cb.setOperator( OPERATOR_AND ); } } list.add( idx, cb ); }
switch ( cb.getOperator() ) { case Condition.OPERATOR_OR: retval = retval || cb.evaluate( rowMeta, r );
setOperator( getOperator( str_operator ) );
if ( r != null ) { condition.setNegated( r.getBoolean( "NEGATED", false ) ); condition.setOperator( Condition.getOperator( r.getString( "OPERATOR", null ) ) );