Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.TypeExpr.sameType()


            valid = isGoodDouble(text);

        } else if (typeExpr.sameType(typeConstants.getIntType()) ||
                   typeExpr.sameType(typeConstants.getByteType()) ||
                   typeExpr.sameType(typeConstants.getShortType()) ||
                   typeExpr.sameType(typeConstants.getLongType())) {
          
            //todoBI the integral types should have different validation to take into account their ranges
          
            valid = isGoodInteger(text);
View Full Code Here


          
            //todoBI the integral types should have different validation to take into account their ranges
          
            valid = isGoodInteger(text);

        } else if (typeExpr.sameType(typeConstants.getIntegerType())) {

            valid = isGoodBigInteger(text);
   
        } else if (typeExpr.sameType(typeConstants.getCharType())) {
View Full Code Here

        } else if (typeExpr.sameType(typeConstants.getIntegerType())) {

            valid = isGoodBigInteger(text);
   
        } else if (typeExpr.sameType(typeConstants.getCharType())) {

            valid = isGoodChar(text);

        } else if (typeExpr.sameType(typeConstants.getCharListType())) {
View Full Code Here

   
        } else if (typeExpr.sameType(typeConstants.getCharType())) {

            valid = isGoodChar(text);

        } else if (typeExpr.sameType(typeConstants.getCharListType())) {

            // Strings are always good!
            valid = true;

        } else if (typeExpr.sameType(typeConstants.getStringType())) {
View Full Code Here

        } else if (typeExpr.sameType(typeConstants.getCharListType())) {

            // Strings are always good!
            valid = true;

        } else if (typeExpr.sameType(typeConstants.getStringType())) {

            // Strings are always good!
            valid = true;

        } else if (typeExpr.isNonParametricType(CAL_RelativeTime.TypeConstructors.RelativeDate) ||
View Full Code Here

        // Now, do the update to the valueNode.
        TypeExpr typeExpr = valueEntryPanel.getValueNode().getTypeExpr();
        PreludeTypeConstants typeConstants = valueEntryPanel.valueEditorManager.getPreludeTypeConstants();
       
        if (typeExpr.sameType(typeConstants.getCharType())) {

            // The first char should be the char we want as the value.
            Character charVal = new Character(newVal.charAt(0));
            valueEntryPanel.replaceValueNode(new LiteralValueNode(charVal, typeExpr.copyTypeExpr()), true);
           
View Full Code Here

            // The first char should be the char we want as the value.
            Character charVal = new Character(newVal.charAt(0));
            valueEntryPanel.replaceValueNode(new LiteralValueNode(charVal, typeExpr.copyTypeExpr()), true);
           
        } else if (typeExpr.sameType(typeConstants.getByteType())) {

            Double unRoundedVal = new Double(newVal);
            Byte byteVal = new Byte(unRoundedVal.byteValue());
            valueEntryPanel.replaceValueNode(new LiteralValueNode(byteVal, typeExpr.copyTypeExpr()), true);
     
View Full Code Here

            Double unRoundedVal = new Double(newVal);
            Byte byteVal = new Byte(unRoundedVal.byteValue());
            valueEntryPanel.replaceValueNode(new LiteralValueNode(byteVal, typeExpr.copyTypeExpr()), true);
     
        } else if (typeExpr.sameType(typeConstants.getShortType())) {

            Double unRoundedVal = new Double(newVal);
            Short shortVal = new Short(unRoundedVal.shortValue());
            valueEntryPanel.replaceValueNode(new LiteralValueNode(shortVal, typeExpr.copyTypeExpr()), true);
             
View Full Code Here

            Double unRoundedVal = new Double(newVal);
            Short shortVal = new Short(unRoundedVal.shortValue());
            valueEntryPanel.replaceValueNode(new LiteralValueNode(shortVal, typeExpr.copyTypeExpr()), true);
             
        } else if (typeExpr.sameType(typeConstants.getIntType())) {

            Double unRoundedVal = new Double(newVal);
            Integer integerVal = Integer.valueOf(unRoundedVal.intValue());
            valueEntryPanel.replaceValueNode(new LiteralValueNode(integerVal, typeExpr.copyTypeExpr()), true);
View Full Code Here

            Double unRoundedVal = new Double(newVal);
            Integer integerVal = Integer.valueOf(unRoundedVal.intValue());
            valueEntryPanel.replaceValueNode(new LiteralValueNode(integerVal, typeExpr.copyTypeExpr()), true);

        } else if (typeExpr.sameType(typeConstants.getIntegerType())) {
           
            BigDecimal unRoundedVal = new BigDecimal(newVal);
            BigInteger bigIntegerVal;
           
            // Math.round uses a rounding strategy that BigDecimal does not provide, so we have to do
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.