ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/extra166y/ParallelArrayWithLongMapping.java
(Generate patch)

Comparing jsr166/src/extra166y/ParallelArrayWithLongMapping.java (file contents):
Revision 1.1 by dl, Tue Jan 6 14:30:58 2009 UTC vs.
Revision 1.6 by jsr166, Sun Jan 18 20:17:32 2015 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   package extra166y;
8 +
9   import jsr166y.*;
10   import static extra166y.Ops.*;
11   import java.util.*;
# Line 24 | Line 25 | public abstract class ParallelArrayWithL
25      }
26  
27      /**
28 <     * Applies the given procedure
28 >     * Applies the given procedure.
29       * @param procedure the procedure
30       */
31      public void apply(LongProcedure procedure) {
# Line 32 | Line 33 | public abstract class ParallelArrayWithL
33      }
34  
35      /**
36 <     * Returns reduction of mapped elements
36 >     * Returns reduction of mapped elements.
37       * @param reducer the reducer
38       * @param base the result for an empty array
39       * @return reduction
# Line 45 | Line 46 | public abstract class ParallelArrayWithL
46      }
47  
48      /**
49 <     * Returns the minimum element, or Long.MAX_VALUE if empty
49 >     * Returns the minimum element, or Long.MAX_VALUE if empty.
50       * @return minimum element, or Long.MAX_VALUE if empty
51       */
52      public long min() {
# Line 53 | Line 54 | public abstract class ParallelArrayWithL
54      }
55  
56      /**
57 <     * Returns the minimum element, or Long.MAX_VALUE if empty
57 >     * Returns the minimum element, or Long.MAX_VALUE if empty.
58       * @param comparator the comparator
59       * @return minimum element, or Long.MAX_VALUE if empty
60       */
# Line 62 | Line 63 | public abstract class ParallelArrayWithL
63      }
64  
65      /**
66 <     * Returns the maximum element, or Long.MIN_VALUE if empty
66 >     * Returns the maximum element, or Long.MIN_VALUE if empty.
67       * @return maximum element, or Long.MIN_VALUE if empty
68       */
69      public long max() {
# Line 70 | Line 71 | public abstract class ParallelArrayWithL
71      }
72  
73      /**
74 <     * Returns the maximum element, or Long.MIN_VALUE if empty
74 >     * Returns the maximum element, or Long.MIN_VALUE if empty.
75       * @param comparator the comparator
76       * @return maximum element, or Long.MIN_VALUE if empty
77       */
# Line 79 | Line 80 | public abstract class ParallelArrayWithL
80      }
81  
82      /**
83 <     * Returns the sum of elements
83 >     * Returns the sum of elements.
84       * @return the sum of elements
85       */
86      public long sum() {
# Line 87 | Line 88 | public abstract class ParallelArrayWithL
88      }
89  
90      /**
91 <     * Returns summary statistics
91 >     * Returns summary statistics.
92       * @param comparator the comparator to use for
93       * locating minimum and maximum elements
94 <     * @return the summary.
94 >     * @return the summary
95       */
96      public ParallelLongArray.SummaryStatistics summary
97          (LongComparator comparator) {
# Line 101 | Line 102 | public abstract class ParallelArrayWithL
102      }
103  
104      /**
105 <     * Returns summary statistics, using natural comparator
106 <     * @return the summary.
105 >     * Returns summary statistics, using natural comparator.
106 >     * @return the summary
107       */
108      public ParallelLongArray.SummaryStatistics summary() {
109          return summary(CommonOps.naturalLongComparator());
110      }
111  
112      /**
113 <     * Returns a new ParallelLongArray holding mappings
113 >     * Returns a new ParallelLongArray holding mappings.
114       * @return a new ParallelLongArray holding mappings
115       */
116      public ParallelLongArray all() {
# Line 138 | Line 139 | public abstract class ParallelArrayWithL
139       * @param op the op
140       * @return operation prefix
141       */
142 <    public abstract <U> ParallelArrayWithMapping<T, U> withMapping
142 >    public abstract <U> ParallelArrayWithMapping<T,U> withMapping
143          (LongToObject<? extends U> op);
144  
145      /**
# Line 148 | Line 149 | public abstract class ParallelArrayWithL
149       * @param other the other array
150       * @return operation prefix
151       * @throws IllegalArgumentException if other array is a
152 <     * filtered view (all filters must precede all mappings).
152 >     * filtered view (all filters must precede all mappings)
153       */
154      public <V,W,X> ParallelArrayWithMapping<T,W> withMapping
155          (LongAndObjectToObject<? super V, ? extends W> combiner,
# Line 165 | Line 166 | public abstract class ParallelArrayWithL
166       * @param other the other array
167       * @return operation prefix
168       * @throws IllegalArgumentException if other array is a
169 <     * filtered view (all filters must precede all mappings).
169 >     * filtered view (all filters must precede all mappings)
170       */
171      public <V> ParallelArrayWithMapping<T,V> withMapping
172          (LongAndDoubleToObject<? extends V> combiner,
# Line 182 | Line 183 | public abstract class ParallelArrayWithL
183       * @param other the other array
184       * @return operation prefix
185       * @throws IllegalArgumentException if other array is a
186 <     * filtered view (all filters must precede all mappings).
186 >     * filtered view (all filters must precede all mappings)
187       */
188      public <V> ParallelArrayWithMapping<T,V> withMapping
189          (LongAndLongToObject<? extends V> combiner,
# Line 199 | Line 200 | public abstract class ParallelArrayWithL
200       * @param other the other array
201       * @return operation prefix
202       * @throws IllegalArgumentException if other array is a
203 <     * filtered view (all filters must precede all mappings).
203 >     * filtered view (all filters must precede all mappings)
204       */
205      public <V,W> ParallelArrayWithDoubleMapping<T> withMapping
206          (LongAndObjectToDouble<? super V> combiner,
# Line 216 | Line 217 | public abstract class ParallelArrayWithL
217       * @param other the other array
218       * @return operation prefix
219       * @throws IllegalArgumentException if other array is a
220 <     * filtered view (all filters must precede all mappings).
220 >     * filtered view (all filters must precede all mappings)
221       */
222      public ParallelArrayWithDoubleMapping<T> withMapping
223          (LongAndDoubleToDouble combiner,
# Line 234 | Line 235 | public abstract class ParallelArrayWithL
235       * @param other the other array
236       * @return operation prefix
237       * @throws IllegalArgumentException if other array is a
238 <     * filtered view (all filters must precede all mappings).
238 >     * filtered view (all filters must precede all mappings)
239       */
240      public ParallelArrayWithDoubleMapping<T> withMapping
241          (LongAndLongToDouble combiner,
# Line 251 | Line 252 | public abstract class ParallelArrayWithL
252       * @param other the other array
253       * @return operation prefix
254       * @throws IllegalArgumentException if other array is a
255 <     * filtered view (all filters must precede all mappings).
255 >     * filtered view (all filters must precede all mappings)
256       */
257      public <V,W> ParallelArrayWithLongMapping<T> withMapping
258          (LongAndObjectToLong<? super V> combiner,
# Line 269 | Line 270 | public abstract class ParallelArrayWithL
270       * @param other the other array
271       * @return operation prefix
272       * @throws IllegalArgumentException if other array is a
273 <     * filtered view (all filters must precede all mappings).
273 >     * filtered view (all filters must precede all mappings)
274       */
275      public ParallelArrayWithLongMapping<T> withMapping
276          (LongAndDoubleToLong combiner,
# Line 287 | Line 288 | public abstract class ParallelArrayWithL
288       * @param other the other array
289       * @return operation prefix
290       * @throws IllegalArgumentException if other array is a
291 <     * filtered view (all filters must precede all mappings).
291 >     * filtered view (all filters must precede all mappings)
292       */
293      public ParallelArrayWithLongMapping<T> withMapping
294          (BinaryLongOp combiner,
# Line 336 | Line 337 | public abstract class ParallelArrayWithL
337      /**
338       * Returns an Iterable view to sequentially step through mapped
339       * elements also obeying bound and filter constraints, without
340 <     * performing computations to evaluate them in parallel
340 >     * performing computations to evaluate them in parallel.
341       * @return the Iterable view
342       */
343      public Iterable<Long> sequentially() {
344          return new SequentiallyAsLong();
345      }
346   }
346

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines