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
.jvm
.suite
;
12 import cc
.squirreljme
.runtime
.cldc
.annotation
.Exported
;
13 import cc
.squirreljme
.runtime
.cldc
.util
.StringUtils
;
16 * This represents the vendor of a midlet suite.
21 public final class SuiteVendor
22 implements Comparable
<SuiteVendor
>
25 protected final String string
;
28 * Initializes the suite vendor.
30 * @param __v The value to parse.
31 * @throws InvalidSuiteException If the input is not valid.
32 * @throws NullPointerException On null arguments.
36 public SuiteVendor(String __v
)
37 throws InvalidSuiteException
, NullPointerException
41 throw new NullPointerException("NARG");
43 // {@squirreljme.error DG0h An illegal character was
44 // specified in the midlet suite vendor. (The midlet suite
46 if (StringUtils
.firstIndex("\0\r\n:;", __v
) >= 0)
47 throw new InvalidSuiteException(String
.format("AD0d %s", __v
));
57 public int compareTo(SuiteVendor __o
)
59 return this.string
.compareTo(__o
.string
);
67 public boolean equals(Object __o
)
70 if (!(__o
instanceof SuiteVendor
))
73 return this.string
.equals(((SuiteVendor
)__o
).string
);
83 return this.string
.hashCode();
91 public String
toString()