AI2 Component  (Version nb184)
Lists.java
Go to the documentation of this file.
1 // -*- mode: java; c-basic-offset: 2; -*-
2 // Copyright 2009-2011 Google, All Rights reserved
3 // Copyright 2011-2012 MIT, All rights reserved
4 // Released under the Apache License, Version 2.0
5 // http://www.apache.org/licenses/LICENSE-2.0
6 
7 package com.google.appinventor.components.runtime.collect;
8 
9 import java.util.ArrayList;
10 import java.util.Collections;
11 
20 public class Lists {
21 
30  public static <E> ArrayList<E> newArrayList() {
31  return new ArrayList<E>();
32  }
33 
52  public static <E> ArrayList<E> newArrayList(E... elements) {
53  int capacity = (elements.length * 110) / 100 + 5;
54  ArrayList<E> list = new ArrayList<E>(capacity);
55  Collections.addAll(list, elements);
56  return list;
57  }
58 }
com.google.appinventor.components.runtime.collect.Lists.newArrayList
static< E > ArrayList< E > newArrayList(E... elements)
Definition: Lists.java:52
com.google.appinventor.components.runtime.collect.Lists.newArrayList
static< E > ArrayList< E > newArrayList()
Definition: Lists.java:30
com.google.appinventor.components.runtime.collect.Lists
Definition: Lists.java:20