-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathListUtils.java
More file actions
57 lines (46 loc) · 1.7 KB
/
ListUtils.java
File metadata and controls
57 lines (46 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package org.anddev.andengine.util;
import java.util.ArrayList;
/**
* (c) 2010 Nicolas Gramlich
* (c) 2011 Zynga Inc.
*
* @author Nicolas Gramlich
* @since 12:43:39 - 11.03.2010
*/
public class ListUtils {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
// ===========================================================
// Constructors
// ===========================================================
private ListUtils() {}
// ===========================================================
// Getter & Setter
// ===========================================================
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
// ===========================================================
// Methods
// ===========================================================
public static <T> ArrayList<? extends T> toList(final T pItem) {
final ArrayList<T> out = new ArrayList<T>();
out.add(pItem);
return out;
}
public static <T> ArrayList<? extends T> toList(final T ... pItems) {
final ArrayList<T> out = new ArrayList<T>();
final int itemCount = pItems.length;
for(int i = 0; i < itemCount; i++) {
out.add(pItems[i]);
}
return out;
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}