1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.plugin
.util
;
12 import java
.time
.DayOfWeek
;
13 import java
.time
.LocalDate
;
15 import java
.util
.TreeMap
;
18 * Represents the week.
25 public final Map
<DayOfWeek
, NoteDay
> weekdays
=
28 /** The week of the year. */
29 public final int week
;
32 * Initializes the week.
34 * @param __num The week number.
37 public NoteWeek(int __num
)
45 * @param __date The date.
46 * @param __fileName The file name.
48 * @throws NullPointerException On null arguments.
51 public NoteDay
add(LocalDate __date
, String __fileName
)
52 throws NullPointerException
54 if (__date
== null || __fileName
== null)
55 throw new NullPointerException("NARG");
57 return this.weekdays
.computeIfAbsent(__date
.getDayOfWeek(),
58 __key
-> new NoteDay(__date
, __fileName
));