Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.DecimalLiteralImpl


          BigDecimal left = leftLit.decimalValue();
          BigDecimal right = rightLit.decimalValue();

          switch (op) {
            case PLUS:
              return new DecimalLiteralImpl(left.add(right));
            case MINUS:
              return new DecimalLiteralImpl(left.subtract(right));
            case MULTIPLY:
              return new DecimalLiteralImpl(left.multiply(right));
            case DIVIDE:
              // Divide by zero handled through NumberFormatException
              return new DecimalLiteralImpl(left.divide(right, RoundingMode.HALF_UP));
            default:
              throw new IllegalArgumentException("Unknown operator: " + op);
          }
        }
        else { // XMLSchema.INTEGER
View Full Code Here


          BigDecimal left = leftLit.decimalValue();
          BigDecimal right = rightLit.decimalValue();

          switch (op) {
            case PLUS:
              return new DecimalLiteralImpl(left.add(right));
            case MINUS:
              return new DecimalLiteralImpl(left.subtract(right));
            case MULTIPLY:
              return new DecimalLiteralImpl(left.multiply(right));
            case DIVIDE:
              // Divide by zero handled through NumberFormatException
              return new DecimalLiteralImpl(left.divide(right, RoundingMode.HALF_UP));
            default:
              throw new IllegalArgumentException("Unknown operator: " + op);
          }
        }
        else { // XMLSchema.INTEGER
View Full Code Here

TOP

Related Classes of org.openrdf.model.impl.DecimalLiteralImpl

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.