2 * Copyright 2012 Google Inc. Licensed under the Apache License, Version 2.0
3 * (the "License"); you may not use this file except in compliance with the
4 * License. You may obtain a copy of the License at
5 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
6 * or agreed to in writing, software distributed under the License is
7 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 * KIND, either express or implied. See the License for the specific language
9 * governing permissions and limitations under the License.
12 package com.cyanogenmod.eleven.utils;
14 import java.util.ArrayList;
15 import java.util.Collections;
16 import java.util.LinkedList;
19 * Provides static methods for creating {@code List} instances easily, and other
20 * utility methods for working with lists.
22 public final class Lists {
24 /** This class is never instantiated */
29 * Creates an empty {@code ArrayList} instance.
31 * <b>Note:</b> if you only need an <i>immutable</i> empty List, use
32 * {@link Collections#emptyList} instead.
34 * @return a newly-created, initially-empty {@code ArrayList}
36 public static final <E> ArrayList<E> newArrayList() {
37 return new ArrayList<E>();
41 * Creates an empty {@code LinkedList} instance.
43 * <b>Note:</b> if you only need an <i>immutable</i> empty List, use
44 * {@link Collections#emptyList} instead.
46 * @return a newly-created, initially-empty {@code LinkedList}
48 public static final <E> LinkedList<E> newLinkedList() {
49 return new LinkedList<E>();