本文整理汇总了Java中org.threeten.bp.LocalDateTime.equals方法的典型用法代码示例。如果您正苦于以下问题:Java LocalDateTime.equals方法的具体用法?Java LocalDateTime.equals怎么用?Java LocalDateTime.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.threeten.bp.LocalDateTime
的用法示例。
在下文中一共展示了LocalDateTime.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapToScheduleSlots
import org.threeten.bp.LocalDateTime; //导入方法依赖的package包/类
private List<ScheduleSlot> mapToScheduleSlots(@NonNull List<Session> sortedSessions) {
List<ScheduleSlot> slots = new ArrayList<>();
LocalDateTime previousTime = null;
List<Session> previousSessionsList = null;
LocalDateTime currentTime;
for (Session currentSession : sortedSessions) {
currentTime = currentSession.getFromTime();
if (previousSessionsList != null) {
if (currentTime.equals(previousTime)) {
previousSessionsList.add(currentSession);
} else {
slots.add(new ScheduleSlot(previousTime, sortPerRoomId(previousSessionsList)));
previousSessionsList = null;
}
}
if (previousSessionsList == null) {
previousTime = currentTime;
previousSessionsList = new ArrayList<>();
previousSessionsList.add(currentSession);
}
}
if (previousSessionsList != null) {
slots.add(new ScheduleSlot(previousTime, sortPerRoomId(previousSessionsList)));
}
return slots;
}
示例2: mapToScheduleSlots
import org.threeten.bp.LocalDateTime; //导入方法依赖的package包/类
private List<ScheduleSlot> mapToScheduleSlots(@NonNull List<Session> sortedSessions) {
List<ScheduleSlot> slots = new ArrayList<>();
LocalDateTime previousTime = null;
List<Session> previousSessionsList = null;
LocalDateTime currentTime;
for (Session currentSession : sortedSessions) {
currentTime = currentSession.getFromTime();
if (previousSessionsList != null) {
if (currentTime.equals(previousTime)) {
previousSessionsList.add(currentSession);
} else {
slots.add(new ScheduleSlot(previousTime, previousSessionsList));
previousSessionsList = null;
}
}
if (previousSessionsList == null) {
previousTime = currentTime;
previousSessionsList = new ArrayList<>();
previousSessionsList.add(currentSession);
}
}
if (previousSessionsList != null) {
slots.add(new ScheduleSlot(previousTime, previousSessionsList));
}
return slots;
}