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
.runtime
.cldc
.util
;
12 import java
.util
.List
;
13 import java
.util
.RandomAccess
;
16 * General utilities for collections.
20 public final class CollectionUtils
27 private CollectionUtils()
32 * Wraps the given character list as an integer list.
34 * @param __chars The character list to wrap.
35 * @return The resultant integer list.
36 * @throws NullPointerException On null arguments.
39 public static List
<Integer
> asIntegerList(List
<Character
> __chars
)
40 throws NullPointerException
43 throw new NullPointerException("NARG");
45 if (__chars
instanceof RandomAccess
)
46 return new __CharacterIntegerListRandom__(__chars
);
47 return new __CharacterIntegerListSequential__(__chars
);