Java Calendar Time isOverTime(Calendar lastTime, Calendar currentTime, Calendar begTime, Calendar endTime)

Here you can find the source of isOverTime(Calendar lastTime, Calendar currentTime, Calendar begTime, Calendar endTime)

Description

is Over Time

License

Open Source License

Declaration

public static boolean isOverTime(Calendar lastTime,
            Calendar currentTime, Calendar begTime, Calendar endTime) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static boolean isOverTime(Date lastTime, Date currentTime,
            Date begTime, Date endTime) {
        return isOverTime(lastTime.getTime(), currentTime.getTime(),
                begTime.getTime(), endTime.getTime());
    }// w  w w  . ja v  a  2 s.  co m

    public static boolean isOverTime(Calendar lastTime,
            Calendar currentTime, Calendar begTime, Calendar endTime) {
        return isOverTime(lastTime.getTimeInMillis(),
                currentTime.getTimeInMillis(), begTime.getTimeInMillis(),
                endTime.getTimeInMillis());
    }

    public static boolean isOverTime(long lastTime, long currentTime,
            long begTime, long endTime) {
        boolean result = false;
        if ((lastTime != 0 && lastTime < begTime && currentTime >= begTime)
                || (lastTime >= begTime && currentTime >= endTime)) {
            result = true;
        }
        return result;
    }
}

Related

  1. hasTimePart(Calendar calendar)
  2. isEquals(Calendar startTime, Calendar timeCurrent, int type)
  3. isFirstMorning(Calendar time, Calendar previous)
  4. isFuture(Calendar time)
  5. isMorning(Calendar time)
  6. isSameLocalTime(Calendar cal1, Calendar cal2)
  7. isSameLocalTime(Calendar cal1, Calendar cal2)
  8. isSameTime(final Calendar aCal1, final Calendar aCal2)
  9. isSleepTime(Calendar calendar, String sleepTimeStart, String sleepTimeEnd)