Package org.eclipse.jst.jsf.common.internal.types

Examples of org.eclipse.jst.jsf.common.internal.types.FloatLiteralType


            case JSPELParserConstants.INTEGER_LITERAL:
                type = new IntegerLiteralType(Long.parseLong(literalToken.image));
                break;

            case JSPELParserConstants.FLOATING_POINT_LITERAL:
                type = new FloatLiteralType(Double.parseDouble(literalToken.image));
                break;

            case JSPELParserConstants.FALSE:
                type = BooleanLiteralType.FALSE;
                break;
View Full Code Here


                firstValue = ((LiteralType)firstArg).coerceToNumber(Double.class);
            }
           
            if (firstValue != null && secondValue != null)
            {
                return new FloatLiteralType(
                        doRealOperation(new Double(firstValue.doubleValue())
                                , new Double(secondValue.doubleValue())).doubleValue());
            }

            // if not both literals and could coerce, then the type is double
View Full Code Here

                            || literalValue.indexOf('e') > -1
                            || literalValue.indexOf('E') > -1)
                    {
                        // if it coerces to double, then it's a double
                        Number value = ((LiteralType)type).coerceToNumber(Double.class);
                        return new FloatLiteralType(-1 * value.doubleValue());
                    }
   
                    // if it coerces to long, then it's a long
                    Number value = ((LiteralType)type).coerceToNumber(Long.class);
                    return new IntegerLiteralType(-1 * value.longValue());
                }
               
                // otherwise, just return a long typed value
                return new ValueType(Signature.SIG_LONG, IAssignable.ASSIGNMENT_TYPE_RHS);
            }
           
            // JSP.2.3.5.4
            // big integer and big decimal retain type
            // all numeric types retain type
            if (TypeCoercer.typeIsNumeric(boxedType))
            {
                // integer and float literals are special because -1 or -1.0
                // is syntically minusOp(1) and minusOp(1.0)
                if (type instanceof IntegerLiteralType)
                {
                    return new IntegerLiteralType(-1 * ((IntegerLiteralType)type).coerceToNumber(Long.class).longValue());
                }
                else if (type instanceof FloatLiteralType)
                {
                    return new FloatLiteralType(-1 * ((FloatLiteralType)type).coerceToNumber(Double.class).doubleValue());
                }
                return type;
            }
          
            // all other cases, return null
View Full Code Here

                firstValue = ((LiteralType)firstArg).coerceToNumber(Double.class);
            }
           
            if (firstValue != null && secondValue != null)
            {
                return new FloatLiteralType(
                        doRealOperation(new Double(firstValue.doubleValue()),
                                        new Double(secondValue.doubleValue())).doubleValue());
            }

            // if we get to here, the coercion is valid, so a Double will be
View Full Code Here

                    if (numberType == Double.class)
                    {
                        Double resultValue =
                            doRealOperation((Double)firstValue,
                                    (Double) secondValue);
                        result = new FloatLiteralType(resultValue.doubleValue());
                    }
                    else if (numberType == Long.class)
                    {
                        Long resultValue =
                            doRealOperation((Long) firstValue, (Long) secondValue);
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsf.common.internal.types.FloatLiteralType

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.