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 ); }
if ( condition.getFunction() != Condition.FUNC_NOT_NULL && condition.getFunction() != Condition.FUNC_NULL ) { String re = rightex == null ? "" : rightex; String stype = "";
selection = esd.open( defnr ); if ( selection != null ) { int fnnr = Condition.getFunction( selection ); active_condition.setFunction( fnnr ); if ( active_condition.getFunction() == Condition.FUNC_NOT_NULL || active_condition.getFunction() == Condition.FUNC_NULL ) { active_condition.setRightValuename( null ); active_condition.setRightExact( null );
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 ); }
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() ); } } }
setFunction( getFunction( XMLHandler.getTagValue( condnode, "function" ) ) ); setRightValuename( XMLHandler.getTagValue( condnode, "rightvalue" ) ); Node exactnode = XMLHandler.getSubNode( condnode, ValueMetaAndData.XML_TAG );
condition.setFunction( Condition.getFunction( comparator ) ); condition.setRightValuename( field ); condition.setRightExact( new ValueMetaAndData( "value", value ) ); subc.setFunction( Condition.getFunction( comparator ) ); subc.setRightValuename( field ); subc.setRightExact( new ValueMetaAndData( "value", value ) );
if ( subids.length == 0 ) { condition.setLeftValuename( r.getString( "LEFT_NAME", null ) ); condition.setFunction( Condition.getFunction( r.getString( "CONDITION_FUNCTION", null ) ) ); condition.setRightValuename( r.getString( "RIGHT_NAME", null ) );