Remove clashing error prefix; Use better name for RatufaCoat ROMs.
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / util / NoteMonth.java
blob9f123ce43713ab3f409e4bdb858e935cfc26fc5f
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
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;
13 import java.time.temporal.IsoFields;
14 import java.util.Map;
15 import java.util.TreeMap;
17 /**
18 * Represents the month.
20 * @since 2020/06/27
22 public class NoteMonth
24 /** The weeks. */
25 public final Map<Integer, NoteWeek> weeks =
26 new TreeMap<>();
28 /** The month number. */
29 public final int month;
31 /** The date. */
32 public final LocalDate date;
34 /**
35 * Initializes the month.
37 * @param __date The date.
38 * @param __num The month number.
39 * @throws NullPointerException On null arguments.
40 * @since 2020/06/27
42 public NoteMonth(LocalDate __date, int __num)
43 throws NullPointerException
45 if (__date == null)
46 throw new NullPointerException("NARG");
48 this.date = __date;
49 this.month = __num;
52 /**
53 * Adds a week.
55 * @param __date The date.
56 * @param __fileName The file name.
57 * @return The week.
58 * @throws NullPointerException On null arguments.
59 * @since 2020/06/27
61 public NoteWeek add(LocalDate __date, String __fileName)
62 throws NullPointerException
64 if (__date == null || __fileName == null)
65 throw new NullPointerException("NARG");
67 int weekNum = __date.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR);
68 NoteWeek rv = this.weeks.computeIfAbsent(weekNum,
69 __key -> new NoteWeek(__key));
71 rv.add(__date, __fileName);
73 return rv;