Package org.openquark.cal.compiler

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


                bigIntegerVal = unRoundedVal.setScale(0, BigDecimal.ROUND_HALF_DOWN).toBigInteger();
            }
           
            valueEntryPanel.replaceValueNode(new LiteralValueNode(bigIntegerVal, typeExpr.copyTypeExpr()), true);
       
        } else if (typeExpr.sameType(typeConstants.getDecimalType())) {

            BigDecimal decimalVal = new BigDecimal(newVal);
            valueEntryPanel.replaceValueNode(new LiteralValueNode(decimalVal, typeExpr.copyTypeExpr()), true);

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


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

            BigDecimal decimalVal = new BigDecimal(newVal);
            valueEntryPanel.replaceValueNode(new LiteralValueNode(decimalVal, typeExpr.copyTypeExpr()), true);

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

            Double unRoundedVal = new Double(newVal);
            Long longVal = new Long(unRoundedVal.longValue());
            valueEntryPanel.replaceValueNode(new LiteralValueNode(longVal, typeExpr.copyTypeExpr()), true);
View Full Code Here

            Double unRoundedVal = new Double(newVal);
            Long longVal = new Long(unRoundedVal.longValue());
            valueEntryPanel.replaceValueNode(new LiteralValueNode(longVal, typeExpr.copyTypeExpr()), true);

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

            Float floatVal = new Float(newVal);
            valueEntryPanel.replaceValueNode(new LiteralValueNode(floatVal, typeExpr.copyTypeExpr()), true);

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

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

            Float floatVal = new Float(newVal);
            valueEntryPanel.replaceValueNode(new LiteralValueNode(floatVal, typeExpr.copyTypeExpr()), true);

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

            Double doubleVal = new Double(newVal);
            valueEntryPanel.replaceValueNode(new LiteralValueNode(doubleVal, typeExpr.copyTypeExpr()), true);

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

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

            Double doubleVal = new Double(newVal);
            valueEntryPanel.replaceValueNode(new LiteralValueNode(doubleVal, typeExpr.copyTypeExpr()), true);

        } else if (typeExpr.sameType(typeConstants.getStringType())) {
           
            newVal = newVal.replace(ListOfCharValueNode.CHAR_RETURN_REPLACE, '\n');
            valueEntryPanel.replaceValueNode(new LiteralValueNode(newVal, typeExpr.copyTypeExpr()), true);
           
        } else if (typeExpr.sameType(typeConstants.getCharListType())) {
View Full Code Here

        } else if (typeExpr.sameType(typeConstants.getStringType())) {
           
            newVal = newVal.replace(ListOfCharValueNode.CHAR_RETURN_REPLACE, '\n');
            valueEntryPanel.replaceValueNode(new LiteralValueNode(newVal, typeExpr.copyTypeExpr()), true);
           
        } else if (typeExpr.sameType(typeConstants.getCharListType())) {

            // First, must replace the return replacement chars with return.
            newVal = newVal.replace(ListOfCharValueNode.CHAR_RETURN_REPLACE, '\n');
            valueEntryPanel.replaceValueNode(new ListOfCharValueNode(newVal, typeExpr.copyTypeExpr()), true);
       
View Full Code Here

        TypeExpr typeExpr = valueEntryPanel.getValueNode().getTypeExpr();
       
        PreludeTypeConstants typeConstants = valueEntryPanel.valueEditorManager.getPreludeTypeConstants();
      
        if (typeExpr.sameType(typeConstants.getDoubleType()) ||
            typeExpr.sameType(typeConstants.getFloatType())) {
               
            // Remove trailing -
            len = currentText.length();
            if (len > 0) {
View Full Code Here

        TypeExpr typeExpr = valueEntryPanel.getValueNode().getTypeExpr();
       
        PreludeTypeConstants typeConstants = valueEntryPanel.valueEditorManager.getPreludeTypeConstants();
      
        if (typeExpr.sameType(typeConstants.getDoubleType()) ||
            typeExpr.sameType(typeConstants.getFloatType())) {
               
            // Remove trailing -
            len = currentText.length();
            if (len > 0) {
                char lastChar = currentText.charAt(len - 1);
View Full Code Here

                    len++;
                    changed = true;
                }
            }

        } else if (typeExpr.sameType(typeConstants.getDecimalType())) {
               
            // Remove trailing -
            len = currentText.length();
            if (len > 0) {
                char lastChar = currentText.charAt(len - 1);
View Full Code Here

        ValueNode returnVN = null;
        TypeExpr typeExpr = getValueNode().getTypeExpr();
       
        PreludeTypeConstants typeConstants = valueEditorManager.getValueNodeBuilderHelper().getPreludeTypeConstants();
       
        if (typeExpr.sameType(typeConstants.getByteType())) {

            Double unRoundedVal = new Double(getDisplayField().getText());
            Byte byteVal = new Byte((byte) Math.round(unRoundedVal.doubleValue()));

            returnVN = new LiteralValueNode(byteVal, getValueNode().getTypeExpr());
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.