Package net.sf.saxon.value

Examples of net.sf.saxon.value.NumericValue.compareTo()


        public SequenceIterator call(SequenceIterator[] arguments, XPathContext context) throws XPathException {
            NumericValue index = (NumericValue)arguments[1].next();
            if (index == null) {
                return EmptyIterator.getInstance();
            }
            if (index.compareTo(Integer.MAX_VALUE) <= 0 && index.isWholeNumber()) {
                int intindex = (int)index.longValue();
                if (intindex < 1) {
                    return EmptyIterator.getInstance();
                }
                Item item;
View Full Code Here


        if (start instanceof IntegerValue) {
            lstart = ((IntegerValue)start).longValue();
        } else {
            NumericValue rstart = start.round();
            // We need to be careful to handle cases such as plus/minus infinity
            if (rstart.compareTo(IntegerValue.ZERO) <= 0) {
                return s;
            } else if (rstart.compareTo(new IntegerValue(slength)) > 0) {
                // this works even where the string contains surrogate pairs,
                // because the Java length is always >= the XPath length
                return "";
View Full Code Here

        } else {
            NumericValue rstart = start.round();
            // We need to be careful to handle cases such as plus/minus infinity
            if (rstart.compareTo(IntegerValue.ZERO) <= 0) {
                return s;
            } else if (rstart.compareTo(new IntegerValue(slength)) > 0) {
                // this works even where the string contains surrogate pairs,
                // because the Java length is always >= the XPath length
                return "";
            } else {
                try {
View Full Code Here

        long lend;
        if (end instanceof IntegerValue) {
            lend = ((IntegerValue)end).longValue();
        } else {
            // We need to be careful to handle cases such as plus/minus infinity and NaN
            if (end.compareTo(IntegerValue.ZERO) <= 0) {
                return "";
            } else if (end.isNaN()) {
                return "";
            } else if (end.compareTo(new IntegerValue(slength)) > 0) {
                // this works even where the string contains surrogate pairs,
View Full Code Here

            // We need to be careful to handle cases such as plus/minus infinity and NaN
            if (end.compareTo(IntegerValue.ZERO) <= 0) {
                return "";
            } else if (end.isNaN()) {
                return "";
            } else if (end.compareTo(new IntegerValue(slength)) > 0) {
                // this works even where the string contains surrogate pairs,
                // because the Java length is always >= the XPath length
                lend = slength+1;
            } else {
                try {
View Full Code Here

                        num = (NumericValue) val;
                    } else {
                        num = NumberFn.convert(val);
                    }
                    num = num.round();
                    if (num.compareTo(IntegerValue.MAX_LONG) > 0) {
                        DynamicError e = new DynamicError("A number is too large to be formatted");
                        e.setXPathContext(context);
                        e.setErrorCode("SAXON:0000");
                        throw e;
                    }
View Full Code Here

                        DynamicError e = new DynamicError("A number is too large to be formatted");
                        e.setXPathContext(context);
                        e.setErrorCode("SAXON:0000");
                        throw e;
                    }
                    if (num.compareTo(IntegerValue.MIN_LONG) < 0) {
                        DynamicError e = new DynamicError("The numbers to be formatted must be positive");
                        e.setXPathContext(context);
                        e.setErrorCode("XT0980");
                        throw e;
                    }
View Full Code Here

            if (range == null) {
                range = new NumericValue[2];
                range[0] = val;
                range[1] = val;
            } else {
                if (val.compareTo(range[0]) < 0) {
                    range[0] = val;
                }
                if (val.compareTo(range[1]) > 0) {
                    range[1] = val;
                }
View Full Code Here

                range[1] = val;
            } else {
                if (val.compareTo(range[0]) < 0) {
                    range[0] = val;
                }
                if (val.compareTo(range[1]) > 0) {
                    range[1] = val;
                }
            }
        }
        return range;
View Full Code Here

            // We need to be careful to handle cases such as plus/minus infinity
            if (rstart.isNaN()) {
                return "";
            } else if (rstart.signum() <= 0) {
                return s;
            } else if (rstart.compareTo(slength) > 0) {
                // this works even where the string contains surrogate pairs,
                // because the Java length is always >= the XPath length
                return "";
            } else {
                try {
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.