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 Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.plugin
.swm
;
12 import cc
.squirreljme
.plugin
.util
.StringUtils
;
15 * This represents the name of a midlet suite.
19 public final class SuiteName
20 implements Comparable
<SuiteName
>
23 protected final String string
;
26 * Initializes the suite name.
28 * @param __v The value to parse.
29 * @throws InvalidSuiteException If the input is not valid.
30 * @throws NullPointerException On null arguments.
33 public SuiteName(String __v
)
34 throws InvalidSuiteException
, NullPointerException
38 throw new NullPointerException("NARG");
40 /* {@squirreljme.error DG0e An illegal character was
41 specified in the midlet suite name. (The midlet suite
43 if (StringUtils
.firstIndex("\0\r\n:;", __v
) >= 0)
44 throw new InvalidSuiteException(String
.format("AR0e %s", __v
));
54 public int compareTo(SuiteName __o
)
58 return this.string
.compareTo(__o
.string
);
66 public boolean equals(Object __o
)
72 if (!(__o
instanceof SuiteName
))
75 return this.string
.equals(((SuiteName
)__o
).string
);
85 return this.string
.hashCode();
93 public String
toString()