Package com.ibm.icu.util

Examples of com.ibm.icu.util.Calendar


            return true;
        }

        @Override
        public Calendar next(Calendar cal, ExpressionContext context) {
            Calendar next = (Calendar) cal.clone();
            for (TemporalExpression expression : this.expressionSet) {
                next = expression.next(next, context);
                if (next == null) {
                    return null;
                }
View Full Code Here


            return false;
        }

        @Override
        public Calendar first(Calendar cal) {
            Calendar first = (Calendar) cal.clone();
            while (!includesDate(first)) {
                first.add(Calendar.MINUTE, 1);
            }
            return first;
        }
View Full Code Here

        public Set<Integer> getMinuteRangeAsSet() {
            Set<Integer> rangeSet = new TreeSet<Integer>();
            if (this.start == this.end) {
                rangeSet.add(this.start);
            } else {
                Calendar cal = Calendar.getInstance();
                cal.set(Calendar.HOUR_OF_DAY, this.start);
                while (cal.get(Calendar.HOUR_OF_DAY) != this.end) {
                    rangeSet.add(cal.get(Calendar.HOUR_OF_DAY));
                    cal.add(Calendar.HOUR_OF_DAY, 1);
                }
            }
            return rangeSet;
        }
View Full Code Here

        public boolean includesDate(Calendar cal) {
            int minute = cal.get(Calendar.MINUTE);
            if (minute == this.start || minute == this.end) {
                return true;
            }
            Calendar compareCal = (Calendar) cal.clone();
            compareCal.set(Calendar.MINUTE, this.start);
            while (compareCal.get(Calendar.MINUTE) != this.end) {
                if (compareCal.get(Calendar.MINUTE) == minute) {
                    return true;
                }
                compareCal.add(Calendar.MINUTE, 1);
            }
            return false;
        }
View Full Code Here

            return false;
        }

        @Override
        public boolean isSubstitutionCandidate(Calendar cal, TemporalExpression expressionToTest) {
            Calendar checkCal = (Calendar) cal.clone();
            checkCal.add(Calendar.MINUTE, -1);
            while (!includesDate(checkCal)) {
                if (expressionToTest.includesDate(checkCal)) {
                    return true;
                }
                checkCal.add(Calendar.MINUTE, -1);
            }
            return false;
        }
View Full Code Here

            return false;
        }

        @Override
        public Calendar next(Calendar cal, ExpressionContext context) {
            Calendar next = (Calendar) cal.clone();
            if (includesDate(next)) {
                next.add(Calendar.MINUTE, 1);
            }
            while (!includesDate(next)) {
                next.add(Calendar.MINUTE, 1);
            }
            if (cal.get(Calendar.HOUR_OF_DAY) != next.get(Calendar.HOUR_OF_DAY)) {
                context.hourBumped = true;
            }
            return next;
        }
View Full Code Here

            return false;
        }

        @Override
        public Calendar first(Calendar cal) {
            Calendar first = (Calendar) cal.clone();
            first.set(Calendar.DAY_OF_MONTH, 1);
            while (!includesDate(first)) {
                first.add(Calendar.MONTH, 1);
            }
            return first;
        }
View Full Code Here

        public boolean includesDate(Calendar cal) {
            int month = cal.get(Calendar.MONTH);
            if (month == this.start || month == this.end) {
                return true;
            }
            Calendar compareCal = (Calendar) cal.clone();
            while (compareCal.get(Calendar.MONTH) != this.start) {
                compareCal.add(Calendar.MONTH, 1);
            }
            while (compareCal.get(Calendar.MONTH) != this.end) {
                if (compareCal.get(Calendar.MONTH) == month) {
                    return true;
                }
                compareCal.add(Calendar.MONTH, 1);
            }
            return false;
        }
View Full Code Here

            return false;
        }

        @Override
        public boolean isSubstitutionCandidate(Calendar cal, TemporalExpression expressionToTest) {
            Calendar checkCal = (Calendar) cal.clone();
            checkCal.add(Calendar.MONTH, -1);
            while (!includesDate(checkCal)) {
                if (expressionToTest.includesDate(checkCal)) {
                    return true;
                }
                checkCal.add(Calendar.MONTH, -1);
            }
            return false;
        }
View Full Code Here

            return false;
        }

        @Override
        public Calendar next(Calendar cal, ExpressionContext context) {
            Calendar next = (Calendar) cal.clone();
            next.set(Calendar.DAY_OF_MONTH, 1);
            next.add(Calendar.MONTH, 1);
            while (!includesDate(next)) {
                next.add(Calendar.MONTH, 1);
            }
            return next;
        }
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.Calendar

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.