tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r949811 - in /tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func: ArrayFlow.java F.java FlowImpl.java
Date Mon, 31 May 2010 17:33:40 GMT
Author: hlship
Date: Mon May 31 17:33:40 2010
New Revision: 949811

URL: http://svn.apache.org/viewvc?rev=949811&view=rev
Log:
Rename FlowImpl to ArrayFlow

Added:
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/ArrayFlow.java
  (contents, props changed)
      - copied, changed from r949214, tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/FlowImpl.java
Removed:
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/FlowImpl.java
Modified:
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/F.java

Copied: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/ArrayFlow.java
(from r949214, tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/FlowImpl.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/ArrayFlow.java?p2=tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/ArrayFlow.java&p1=tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/FlowImpl.java&r1=949214&r2=949811&rev=949811&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/FlowImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/ArrayFlow.java
Mon May 31 17:33:40 2010
@@ -25,7 +25,10 @@ import java.util.List;
 import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry5.ioc.internal.util.Defense;
 
-class FlowImpl<T> implements Flow<T>
+/**
+ * Implementation of {@link Flow} based on an internal array of objects.
+ */
+class ArrayFlow<T> implements Flow<T>
 {
     private final T[] values;
 
@@ -35,17 +38,17 @@ class FlowImpl<T> implements Flow<T>
     private Flow<T> rest;
 
     @SuppressWarnings("unchecked")
-    FlowImpl(Collection<T> values)
+    ArrayFlow(Collection<T> values)
     {
         this((T[]) values.toArray());
     }
 
-    FlowImpl(T[] values)
+    ArrayFlow(T[] values)
     {
         this(values, 0, values.length);
     }
 
-    FlowImpl(T[] values, int start, int count)
+    ArrayFlow(T[] values, int start, int count)
     {
         this.values = values;
         this.start = start;
@@ -77,7 +80,7 @@ class FlowImpl<T> implements Flow<T>
                 result.add(value);
         }
 
-        return new FlowImpl<T>(result);
+        return new ArrayFlow<T>(result);
     }
 
     public Flow<T> remove(Predicate<? super T> predicate)
@@ -95,7 +98,7 @@ class FlowImpl<T> implements Flow<T>
         if (isEmpty())
         {
             List<X> empty = Collections.emptyList();
-            return new FlowImpl<X>(empty);
+            return new ArrayFlow<X>(empty);
         }
 
         X[] newValues = (X[]) new Object[values.length];
@@ -106,7 +109,7 @@ class FlowImpl<T> implements Flow<T>
             newValues[i] = mapper.map(value);
         }
 
-        return new FlowImpl<X>(newValues);
+        return new ArrayFlow<X>(newValues);
     }
 
     public <A> A reduce(Reducer<A, T> reducer, A initial)
@@ -142,7 +145,7 @@ class FlowImpl<T> implements Flow<T>
 
         Collections.reverse(newValues);
 
-        return new FlowImpl<T>(newValues);
+        return new ArrayFlow<T>(newValues);
     }
 
     public boolean isEmpty()
@@ -160,7 +163,7 @@ class FlowImpl<T> implements Flow<T>
         List<T> newValues = copy();
         newValues.addAll(other.toList());
 
-        return new FlowImpl<T>(newValues);
+        return new ArrayFlow<T>(newValues);
     }
 
     private List<T> copy()
@@ -195,7 +198,7 @@ class FlowImpl<T> implements Flow<T>
 
         Collections.sort(newValues);
 
-        return new FlowImpl<T>((List<T>) newValues);
+        return new ArrayFlow<T>((List<T>) newValues);
     }
 
     public Flow<T> sort(Comparator<? super T> comparator)
@@ -209,7 +212,7 @@ class FlowImpl<T> implements Flow<T>
 
         Collections.sort(newValues, comparator);
 
-        return new FlowImpl<T>(newValues);
+        return new ArrayFlow<T>(newValues);
     }
 
     public Iterator<T> iterator()
@@ -238,7 +241,7 @@ class FlowImpl<T> implements Flow<T>
         if (isEmpty())
             return this;
 
-        return new FlowImpl<T>(values, start + 1, count - 1);
+        return new ArrayFlow<T>(values, start + 1, count - 1);
     }
 
 }

Propchange: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/ArrayFlow.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/F.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/F.java?rev=949811&r1=949810&r2=949811&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/F.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/func/F.java Mon
May 31 17:33:40 2010
@@ -177,7 +177,7 @@ public class F
      */
     public static <T> Flow<T> flow(Collection<T> values)
     {
-        return new FlowImpl<T>(values);
+        return new ArrayFlow<T>(values);
     }
 
     /**
@@ -186,6 +186,6 @@ public class F
      */
     public static <T> Flow<T> flow(T... values)
     {
-        return new FlowImpl<T>(values);
+        return new ArrayFlow<T>(values);
     }
 }



Mime
View raw message