Examples of IntegerValue


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

        expected.setRoot( type );

        final ActionInsertNode action = new ActionInsertNodeImpl( "Person" );
        action.setLogicalInsertion( false );
        action.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                               new IntegerValue( 25 ) ) );
        type.addChild( action );

        addModelField( "Person",
                       "this",
                       "Person",
View Full Code Here

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

        expected.setRoot( type );

        final ActionInsertNode action = new ActionInsertNodeImpl( "Person" );
        action.setLogicalInsertion( true );
        action.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                               new IntegerValue( 25 ) ) );
        type.addChild( action );

        addModelField( "Person",
                       "this",
                       "Person",
View Full Code Here

Examples of org.exist.xquery.value.IntegerValue

                    ((ValueSequence)resultSequence).keepUnOrdered(unordered);
                }
            }
            Sequence val = null;
            int p = 1;
            final IntegerValue atVal = new IntegerValue(1);
            if(positionalVariable != null)
                {at.setValue(atVal);}
            //Type.EMPTY is *not* a subtype of other types ;
            //the tests below would fail without this prior cardinality check
            if (in.isEmpty() && sequenceType != null &&
                    !Cardinality.checkCardinality(sequenceType.getCardinality(),
                    Cardinality.EMPTY)) {
                throw new XPathException(this, ErrorCodes.XPTY0004,
                    "Invalid cardinality for variable $" + varName +
                    ". Expected " + Cardinality.getDescription(sequenceType.getCardinality()) +
                    ", got " + Cardinality.getDescription(in.getCardinality()));
            }
            // Loop through each variable binding
            p = 0;
            for (final SequenceIterator i = in.iterate(); i.hasNext(); p++) {
                context.proceed(this);
                contextItem = i.nextItem();
                context.setContextSequencePosition(p, in);
                if (positionalVariable != null)
                    {at.setValue(new IntegerValue(p + 1));}
                contextSequence = contextItem.toSequence();
                // set variable value to current item
                var.setValue(contextSequence);
                if (sequenceType == null)
                    {var.checkType();} //because it makes some conversions !
                val = contextSequence;
                // check optional where clause
                if (whereExpr != null && (!fastExec)) {
                    if (contextItem instanceof NodeProxy)
                        {((NodeProxy)contextItem).addContextNode(getExpressionId(), (NodeProxy)contextItem);}
                    final Sequence bool = applyWhereExpression(null);
                    if (contextItem instanceof NodeProxy)
                        {((NodeProxy)contextItem).clearContext(getExpressionId());}
                    // if where returned false, continue
                    if (!bool.effectiveBooleanValue())
                        {continue;}
                } else {
                    val = contextItem.toSequence();
                }
                //Reset the context position
                context.setContextSequencePosition(0, null);
                if (groupedSequence==null) {
                    if (returnExpr instanceof BindingExpression) {
                        ((BindingExpression)returnExpr).eval(null, null, resultSequence, null);
                    // otherwise call the return expression and add results to resultSequence
                    } else {
                        val = returnExpr.eval(null);
                        resultSequence.addAll(val);
                    }
                } else {
                    /* bv : special processing for groupby :
                    if returnExpr is a Binding expression, pass the groupedSequence. 
                    Else, add item to groupedSequence and don't evaluate here ! 
                     */
                    if (returnExpr instanceof BindingExpression){
                        ((BindingExpression)returnExpr).eval(null, null, resultSequence, groupedSequence);
                    } else {
                        final Sequence toGroupSequence = context.resolveVariable(groupedSequence.getToGroupVarName()).getValue();
                        groupedSequence.addAll(toGroupSequence);
                    }
                }
                // free resources
                var.destroy(context, resultSequence);
            }
        } finally {
            // restore the local variable stack
            context.popLocalVariables(mark, resultSequence);
        }
        // bv : Special processing for groupBy : one return per group in groupedSequence
        if (groupSpecs!=null) {
            mark = context.markLocalVariables(false);
            context.declareVariableBinding(var);

            // Declare positional variable if required
            LocalVariable at = null;
            if (positionalVariable != null) {
                at = new LocalVariable(QName.parse(context, positionalVariable, null));
                at.setSequenceType(POSITIONAL_VAR_TYPE);
                context.declareVariableBinding(at);
            }
            final IntegerValue atVal = new IntegerValue(1);
            if(positionalVariable != null) {
                at.setValue(atVal);
            }

            int p = 0;
            for (final Iterator<String> it = groupedSequence.iterate(); it.hasNext(); ) {
                final GroupedValueSequence currentGroup = groupedSequence.get(it.next());
                context.proceed(this);
                // set binding variable to current group
                var.setValue(currentGroup);
                var.checkType();
                //set value of grouping keys for the current group
                for (int i=0; i< groupKeyVar.length ; i ++) {
                    groupKeyVar[i].setValue(currentGroup.getGroupKey().itemAt(i).toSequence());
                }
                if (positionalVariable != null) {
                    final ValueSequence ps = new ValueSequence();
                    for (int i = 0; i < currentGroup.getItemCount(); i++) {
                        ps.add(new IntegerValue(p + i + 1));
                    }
                    at.setValue(ps);
                }
                //evaluate real return expression
                final Sequence val = groupReturnExpr.eval(null);
View Full Code Here

Examples of org.msgpack.type.IntegerValue

    protected Object read(Class<?> cls) {
        readFully(state.getLengthReadBuffer());
        readFully(state.getPacketReadBuffer());
        state.unpack(cls);
        IntegerValue code = (IntegerValue) state.getHeader().get(Key.CODE);
        if (code.getInt() != 0) {
            RawValue error = (RawValue) state.getBody().get(Key.ERROR);
            throw new TarantoolException(code.getInt(), error.getString());
        }
        return state.getBody().get(Key.DATA);
    }
View Full Code Here

Examples of org.msgpack.value.IntegerValue

        }
        Value v = (Value) o;
        if (!v.isInteger()) {
            return false;
        }
        IntegerValue iv = v.asInteger();
        return value.equals(iv.toBigInteger());
    }
View Full Code Here

Examples of org.rhq.enterprise.server.rest.domain.IntegerValue

            criteria.addFilterStartTime(since);
        }
        PageList<Alert> alerts = alertManager.findAlertsByCriteria(caller,criteria);
        int count = alerts.getTotalSize();

        return new IntegerValue(count);
    }
View Full Code Here

Examples of org.rhq.enterprise.server.rest.domain.IntegerValue

        if (!content.exists() || !content.canRead())
            throw new StuffNotFoundException("Content with handle " + handle);

        long len = content.length();

        IntegerValue iv = new IntegerValue((int)len); // TODO

        return iv;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.