Package org.exist.xquery.value

Examples of org.exist.xquery.value.AtomicValue.promote()


                    if (!Type.subTypeOf(min.getType(), Type.NUMBER))
                      {throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(min.getType()) +
                          " and " + Type.getTypeName(value.getType()), min);}
                    if (((NumericValue) value).isNaN()) {
                      //Type NaN correctly
                      value = value.promote(min);                     
                           if (value.getType() == Type.FLOAT)
                               {min = FloatValue.NaN;}
                           else
                               {min = DoubleValue.NaN;}
                           //although result will be NaN, we need to continue on order to type correctly
View Full Code Here


                  if (value instanceof ComputableValue) {
                        if (!(min instanceof ComputableValue))
                            {throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(min.getType()) +
                                    " and " + Type.getTypeName(value.getType()), min);}
                    //Type value correctly
                    value = value.promote(min);
                      min = min.min(collator, value);
                      computableProcessing = true;
                  } else {
                    if (computableProcessing)
                      {throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(min.getType()) +
View Full Code Here

                    if (!Type.subTypeOf(max.getType(), Type.NUMBER))
                      {throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(max.getType()) +
                          " and " + Type.getTypeName(value.getType()), max);}
                    if (((NumericValue) value).isNaN()) {
                      //Type NaN correctly
                      value = value.promote(max);
                            if (value.getType() == Type.FLOAT)
                                   {max = FloatValue.NaN;}
                               else
                                   {max = DoubleValue.NaN;}
                            //although result will be NaN, we need to continue on order to type correctly
View Full Code Here

                      {max = max.promote(value);}
                  }
                  //Ugly test
                  if (max instanceof ComputableValue && value instanceof ComputableValue) {
                    //Type value correctly
                    value = value.promote(max);
                      max = (ComputableValue) max.max(collator, value);
                      computableProcessing = true;
                  } else {
                    if (computableProcessing)
                      {throw new XPathException(this, ErrorCodes.FORG0006, "Cannot compare " + Type.getTypeName(max.getType()) +
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.