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
.LocalDate
;
14 import java
.util
.TreeMap
;
17 * Represents the year.
23 /** The year number. */
24 public final int year
;
27 public final Map
<Integer
, NoteMonth
> months
=
31 * Initializes the year.
33 * @param __num The number.
36 public NoteYear(int __num
)
44 * @param __date The date.
45 * @param __fileName The file name.
46 * @return The added month.
47 * @throws NullPointerException On null arguments.
50 public NoteMonth
add(LocalDate __date
, String __fileName
)
51 throws NullPointerException
53 if (__date
== null || __fileName
== null)
54 throw new NullPointerException("NARG");
56 int monthNum
= __date
.getMonthValue();
57 NoteMonth rv
= this.months
.computeIfAbsent(monthNum
,
58 __key
-> new NoteMonth(__date
, __key
));
60 rv
.add(__date
, __fileName
);