MCPcopy Create free account
hub / github.com/MenoData/Time4J / getStart

Method getStart

base/src/main/java/net/time4j/DayPeriod.java:324–344  ·  view source on GitHub ↗
(PlainTime context)

Source from the content-addressed store, hash-verified

322 * @since 3.13/4.10
323 */
324 public PlainTime getStart(PlainTime context) {
325
326 PlainTime compare = (
327 (context.getHour() == 24)
328 ? PlainTime.midnightAtStartOfDay()
329 : context);
330 PlainTime last = this.codeMap.lastKey();
331
332 for (PlainTime key : this.codeMap.keySet()) {
333 if (compare.isSimultaneous(key)) {
334 return key;
335 } else if (compare.isBefore(key)) {
336 break;
337 } else {
338 last = key;
339 }
340 }
341
342 return last;
343
344 }
345
346 /**
347 * <p>Determines the end of the day period which covers given clock time. </p>

Callers 2

colombiaMorningMethod · 0.95
applyMethod · 0.95

Calls 5

midnightAtStartOfDayMethod · 0.95
isSimultaneousMethod · 0.95
isBeforeMethod · 0.95
keySetMethod · 0.80
getHourMethod · 0.65

Tested by 1

colombiaMorningMethod · 0.76