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() ); } } }
if ( exactnode != null ) { ValueMetaAndData exact = new ValueMetaAndData( exactnode ); setRightExact( exact );
condition.setFunction( Condition.getFunction( comparator ) ); condition.setRightValuename( field ); condition.setRightExact( new ValueMetaAndData( "value", value ) ); } else { for ( int i = 0; i < nrkeys; i++ ) { subc.setFunction( Condition.getFunction( comparator ) ); subc.setRightValuename( field ); subc.setRightExact( new ValueMetaAndData( "value", value ) );
if ( id_value > 0 ) { ValueMetaAndData v = repository.loadValueMetaAndData( new LongObjectId( id_value ) ); condition.setRightExact( v );
active_condition.setRightExact( null ); ValueMetaInterface v = fields.getValueMeta( esd.getSelectionNr() ); active_condition.setRightValuename( v.getName() ); active_condition.setRightExact( null ); setModified(); if ( newval != null ) { active_condition.setRightValuename( null ); active_condition.setRightExact( newval ); setModified();
condition.setOperator( convertOperator( constraint.orig.getCombinationType() ) ); condition.setFunction( Condition.FUNC_EQUAL ); condition.setRightExact( new ValueMetaAndData( "dummy", true ) ); //$NON-NLS-1$ rootCondition.addCondition( condition ); c++; condition.setOperator( convertOperator( constraint.orig.getCombinationType() ) ); condition.setFunction( Condition.FUNC_EQUAL ); condition.setRightExact( new ValueMetaAndData( "dummy", true ) ); //$NON-NLS-1$ rootCondition2.addCondition( condition ); c++;