Code example for Method

Methods: isAnnotationPresent

0
    } 
 
    @Override 
    public RValue optimize() throws EvaluationException { 
        final RValue[] optimizedArgs = new RValue[args.length];
        boolean optimizable = !method.isAnnotationPresent(Dynamic.class);
        int position = getPosition();
        for (int i = 0; i < args.length; ++i) {
            final RValue optimized = optimizedArgs[i] = args[i].optimize();
 
            if (!(optimized instanceof Constant)) {
                optimizable = false;
            } 
 
            if (optimized.getPosition() < position) {
                position = optimized.getPosition();
            } 
        } 
 
        if (optimizable) {
            return new Constant(position, invokeMethod(method, optimizedArgs));
        } else { 
            return new Function(position, method, optimizedArgs);
        } 
    }