当前位置: 首页 > news >正文

做兼职打字员的网站2023年7 8月十大新闻

做兼职打字员的网站,2023年7 8月十大新闻,教育部2024取消编导艺考,教育网站开发用例图/*** 判断2个时间段是否有重叠(交集)* param startDate1 时间段1开始时间戳* param endDate1 时间段1结束时间戳* param startDate2 时间段2开始时间戳* param endDate2 时间段2结束时间戳* param isStrict 是否严格重叠,true 严格&#xff0…

/**

* 判断2个时间段是否有重叠(交集)

* @param startDate1 时间段1开始时间戳

* @param endDate1 时间段1结束时间戳

* @param startDate2 时间段2开始时间戳

* @param endDate2 时间段2结束时间戳

* @param isStrict 是否严格重叠,true 严格,没有任何相交或相等;false 不严格,可以首尾相等,比如2021/5/29-2021/5/31和2021/5/31-2021/6/1,不重叠。

* @return HashMap<String,DateTime> key startDate endDate

* 思路:将有交集的情况列出,若不符合有交集的情况,则无交集

* 有交集的情况

* 1.第一个时间段的开始时间在第二个时间段的开始时间和结束时间当中 第一个时间段的结束时间大于第二个时间段的结束时间

* 2.第一个时间段的结束时间在第二个时间段的开始时间和结束时间当中 第一个时间段的开始时间小于第二个时间段的开始时间

* 3.第一个时间段的开始结束时间在第二个时间段的开始时间和结束时间当中

* 3.第二个时间段的开始结束时间在第一个时间段的开始时间和结束时间当中

* 判断两个时间段是否有交集

*/

public static HashMap<String,DateTime> setOverlap(DateTime startDate1, DateTime endDate1, DateTime startDate2, DateTime endDate2, boolean isStrict){

HashMap<String,DateTime> intersection = new HashMap<>();

if(endDate1.compareTo(startDate1) < 0){

throw new XbootException("endDate1不能小于startDate1");

}

if(endDate2.compareTo(startDate2) < 0){

throw new XbootException("endDate2不能小于startDate2");

}

if(isStrict){

if(startDate1.compareTo(startDate2) >= 0 && startDate1.compareTo(endDate2) <= 0 && endDate1.compareTo(endDate2) > 0){

intersection.put("startDate",startDate1);

intersection.put("endDate",endDate2);

}else if(endDate1.compareTo(startDate2) >= 0 && startDate1.compareTo(endDate2) <= 0 && startDate1.compareTo(startDate2) < 0){

intersection.put("startDate",endDate1);

intersection.put("endDate",endDate2);

}else if(startDate1.compareTo(startDate2) >= 0 && endDate1.compareTo(endDate2) <= 0){

intersection.put("startDate",startDate1);

intersection.put("endDate",endDate1);

}else if((startDate1.compareTo(startDate2) <= 0 && endDate1.compareTo(endDate2) >= 0) ){

intersection.put("startDate",startDate2);

intersection.put("endDate",endDate2);

}

}else{

if(startDate1.compareTo(startDate2) > 0 && startDate1.compareTo(endDate2) < 0 && endDate1.compareTo(endDate2) > 0){

intersection.put("startDate",startDate1);

intersection.put("endDate",endDate2);

}else if(endDate1.compareTo(startDate2) > 0 && startDate1.compareTo(endDate2) < 0 && startDate1.compareTo(startDate2) < 0){

intersection.put("startDate",endDate1);

intersection.put("endDate",endDate2);

}else if(startDate1.compareTo(startDate2) > 0 && endDate1.compareTo(endDate2) < 0){

intersection.put("startDate",startDate1);

intersection.put("endDate",endDate1);

}else if((startDate1.compareTo(startDate2) < 0 && endDate1.compareTo(endDate2) > 0) ){

intersection.put("startDate",startDate2);

intersection.put("endDate",endDate2);

}

}

return intersection;

}

public static HashMap<String,DateTime> getOverlap(DateTime startDate1, DateTime endDate1, DateTime startDate2, DateTime endDate2, boolean isStrict){

Objects.requireNonNull(startDate1, "startDate1");

Objects.requireNonNull(endDate1, "endDate1");

Objects.requireNonNull(startDate2, "startDate2");

Objects.requireNonNull(endDate2, "endDate2");

return setOverlap(startDate1, endDate1, startDate2, endDate2, isStrict);

}

http://www.hkea.cn/news/316830/

相关文章:

  • 做网站找哪个部门吸引人的推广标题
  • 网站制作软件名字线做竞价推广代运营公司
  • avada如何做中英文网站沈阳百度推广排名优化
  • 做网站品长沙网络营销公司排名
  • b2b商贸网站环球网最新消息疫情
  • wordpress next主题什么是seo教程
  • 如何规划一个网站快手秒赞秒评网站推广
  • 中国网站开发网站seo需要用到哪些工具
  • 织梦做的网站首页出现空白网页平台做个业务推广
  • 备案做电影网站吗yandx引擎入口
  • 网站双倍浮动百度账号登陆入口
  • 聊城市网站建设网站推广排名
  • 帝国新闻网站模板百度seo推广怎么做
  • 预约做港澳证的网站网站排名在线优化工具
  • 罗湖实惠的网站建设费用成都官网seo厂家
  • 建设部官方网站有哪些优帮云排名优化
  • 天津做网站找谁新东方在线教育平台官网
  • 南宁做网站在哪了日本预测比分
  • 咋样查看网站用什么编程语言做的9个广州seo推广神技
  • 网站链接太多怎么做网站地图谷歌广告
  • 网站关键词更新临汾网络推广
  • 个人做网站靠什么盈利免费网站建设模板
  • 网站开发 打标签aso优化怎么做
  • 教育校园网站建设方案seo每天一贴
  • 怎么看网站的建设时间推广公司品牌
  • 营销型网站有什么特点英语培训机构
  • 学院网站的系统建设方式宝鸡网站seo
  • 网站客户端怎么做的百度一下了你就知道官网
  • 有什么推广方法优化大师电脑版官方
  • 自己做网站的服务器上海网站建设公司排名