Package org.drools.workbench.models.guided.dtree.shared.model.values.impl

Examples of org.drools.workbench.models.guided.dtree.shared.model.values.impl.IntegerValue


                return null;
            }

        } else if ( DataType.TYPE_NUMERIC_INTEGER.equals( dataType ) ) {
            try {
                return new IntegerValue( new Integer( value ) );

            } catch ( NumberFormatException e ) {
                messages.add( new DataTypeConversionErrorParserMessage( value,
                                                                        Integer.class.getName() ) );
                return null;
View Full Code Here


    }

    @Test
    public void testIntegerValue() {
        final Integer tv = new Integer( 8 );
        final IntegerValue v = new IntegerValue( tv );
        assertEquals( tv,
                      v.getValue() );

        v.setValue( "8" );
        assertEquals( tv,
                      v.getValue() );

        v.setValue( "abc" );
        assertEquals( new Integer( 0 ),
                      v.getValue() );
    }
View Full Code Here

                                                          "==",
                                                          new StringValue( "Michael" ) );
        final ConstraintNode c2 = new ConstraintNodeImpl( "Person",
                                                          "age",
                                                          "==",
                                                          new IntegerValue( 41 ) );
        model.setRoot( type );
        type.addChild( c1 );
        c1.addChild( c2 );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
View Full Code Here

                                                          "==",
                                                          new StringValue( "Michael" ) );
        final ConstraintNode c2 = new ConstraintNodeImpl( "Person",
                                                          "age",
                                                          "==",
                                                          new IntegerValue( 41 ) );
        model.setRoot( type );
        type.addChild( c1 );
        type.addChild( c2 );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
View Full Code Here

                                                          "==",
                                                          new StringValue( "Michael" ) );
        final ConstraintNode c2 = new ConstraintNodeImpl( "Person",
                                                          "age",
                                                          "==",
                                                          new IntegerValue( 41 ) );
        final ConstraintNode c3 = new ConstraintNodeImpl( "Person",
                                                          "gender",
                                                          "==",
                                                          new StringValue( "Male" ) );
        model.setRoot( type );
View Full Code Here

                                                          "==",
                                                          new StringValue( "Fred" ) );
        final ConstraintNode c3 = new ConstraintNodeImpl( "Person",
                                                          "age",
                                                          "==",
                                                          new IntegerValue( 41 ) );
        model.setRoot( type );
        type.addChild( c1 );
        type.addChild( c2 );
        c2.addChild( c3 );
View Full Code Here

        final TypeNode type = new TypeNodeImpl( "Person" );
        final ConstraintNode c1 = new ConstraintNodeImpl( "Person",
                                                          "integerField",
                                                          "==",
                                                          new IntegerValue( 1000000 ) );
        model.setRoot( type );
        type.addChild( c1 );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
        assertEqualsIgnoreWhitespace( expected,
View Full Code Here

        model.setRoot( type );

        final ActionUpdateNode action = new ActionUpdateNodeImpl( type );
        action.setModify( true );
        action.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                               new IntegerValue( 25 ) ) );
        type.addChild( action );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
        assertEqualsIgnoreWhitespace( expected,
                                      drl );
View Full Code Here

        type.addChild( c1 );

        final ActionUpdateNode action = new ActionUpdateNodeImpl( type );
        action.setModify( true );
        action.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                               new IntegerValue( 25 ) ) );
        c1.addChild( action );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
        assertEqualsIgnoreWhitespace( expected,
                                      drl );
View Full Code Here

        model.setRoot( type );

        final ActionUpdateNode action1 = new ActionUpdateNodeImpl( type );
        action1.setModify( true );
        action1.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                                new IntegerValue( 25 ) ) );
        type.addChild( action1 );

        final ActionRetractNode action2 = new ActionRetractNodeImpl( type );
        action1.addChild( action2 );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.dtree.shared.model.values.impl.IntegerValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.