You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2014/04/17 18:38:40 UTC

svn commit: r1588304 - /pivot/trunk/core/src/org/apache/pivot/collections/adapter/ListAdapter.java

Author: rwhitcomb
Date: Thu Apr 17 16:38:40 2014
New Revision: 1588304

URL: http://svn.apache.org/r1588304
Log:
PIVOT-799: Improve operation of Pivot collections objects.

This is just a part of what could be done, according to the issue:
* Add a new constructor to ListAdapter that can take either an Array
  of objects or a variable-length list of objects and convert to
  a Pivot list (using Arrays.asList).  This simplifies using an
  Enum.values() list (for instance) as the basis of Pivot data.

Modified:
    pivot/trunk/core/src/org/apache/pivot/collections/adapter/ListAdapter.java

Modified: pivot/trunk/core/src/org/apache/pivot/collections/adapter/ListAdapter.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/collections/adapter/ListAdapter.java?rev=1588304&r1=1588303&r2=1588304&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/collections/adapter/ListAdapter.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/collections/adapter/ListAdapter.java Thu Apr 17 16:38:40 2014
@@ -17,6 +17,7 @@
 package org.apache.pivot.collections.adapter;
 
 import java.io.Serializable;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
@@ -49,6 +50,11 @@ public class ListAdapter<T> implements L
         this.list = list;
     }
 
+    @SuppressWarnings( "unchecked" )
+    public ListAdapter(T... a) {
+        this.list = Arrays.asList(a);
+    }
+
     public java.util.List<T> getList() {
         return list;
     }