@@ -201,108 +201,87 @@ public final Ix<Boolean> all(Pred<? super T> predicate) {
201201 }
202202
203203 public final Ix <Boolean > hasElements () {
204- // TODO implement
205- throw new UnsupportedOperationException ();
204+ return new IxHasElements <T >(this );
206205 }
207206
208207 public final Ix <T > ignoreElements () {
209- // TODO implement
210- throw new UnsupportedOperationException ();
208+ return new IxIgnoreElements <T >(this );
211209 }
212210
213211 public final Ix <T > max (Comparator <? super T > comparator ) {
214- // TODO implement
215- throw new UnsupportedOperationException ();
212+ return new IxMinMax <T >(this , comparator , -1 );
216213 }
217214
215+ @ SuppressWarnings ({ "rawtypes" , "unchecked" })
218216 public final Ix <T > max () {
219- // TODO implement
220- throw new UnsupportedOperationException ();
217+ return max ((Comparator )SelfComparator .INSTANCE );
221218 }
222219
223220 public final Ix <T > min (Comparator <? super T > comparator ) {
224- // TODO implement
225- throw new UnsupportedOperationException ();
221+ return new IxMinMax <T >(this , comparator , 1 );
226222 }
227223
224+ @ SuppressWarnings ({ "rawtypes" , "unchecked" })
228225 public final Ix <T > min () {
229- // TODO implement
230- throw new UnsupportedOperationException ();
226+ return min ((Comparator )SelfComparator .INSTANCE );
231227 }
232228
233229 public final Ix <Boolean > contains (Object o ) {
234- // TODO implement
235- throw new UnsupportedOperationException ();
230+ return new IxContains <T >(this , o );
236231 }
237232
238233 public final Ix <Integer > count () {
239- // TODO implement
240- throw new UnsupportedOperationException ();
234+ return new IxCount <T >(this );
241235 }
242236
243237 public final Ix <Long > countLong () {
244- // TODO implement
245- throw new UnsupportedOperationException ();
238+ return new IxCountLong <T >(this );
246239 }
247240
248241 public final Ix <T > distinct () {
249- // TODO implement
250- throw new UnsupportedOperationException ();
251- }
252-
253- public final Ix <T > distinct (Pred2 <? super T , ? super T > comparer ) {
254- // TODO implement
255- throw new UnsupportedOperationException ();
242+ return distinct (IdentityHelper .instance ());
256243 }
257244
258245 public final <K > Ix <T > distinct (Func1 <? super T , K > keySelector ) {
259- // TODO implement
260- throw new UnsupportedOperationException ();
246+ return new IxDistinct <T , K >(this , keySelector );
261247 }
262248
263249 public final Ix <T > distinctUntilChanged () {
264- // TODO implement
265- throw new UnsupportedOperationException ();
250+ return distinctUntilChanged (IdentityHelper .instance ());
266251 }
267252
268253 public final Ix <T > distinctUntilChanged (Pred2 <? super T , ? super T > comparer ) {
269- // TODO implement
270- throw new UnsupportedOperationException ();
254+ return new IxDistinctUntilChanged <T , T >(this , IdentityHelper .<T >instance (), comparer );
271255 }
272256
273257 public final <K > Ix <T > distinctUntilChanged (Func1 <? super T , K > keySelector ) {
274- // TODO implement
275- throw new UnsupportedOperationException ();
258+ return new IxDistinctUntilChanged <T , K >(this , keySelector , EqualityHelper .INSTANCE );
276259 }
277260
278261 public final Ix <T > doOnNext (Action1 <? super T > action ) {
279- // TODO implement
280- throw new UnsupportedOperationException ();
262+ return new IxDoOn <T >(this , action , IxEmptyAction .instance0 ());
281263 }
282264
283- public final Ix <T > doOnCompleted (Action1 <? super T > action ) {
284- // TODO implement
285- throw new UnsupportedOperationException ();
265+ public final Ix <T > doOnCompleted (Action0 action ) {
266+ return new IxDoOn <T >(this , IxEmptyAction .instance1 (), action );
286267 }
287268
288- public final Ix < T > startWith ( T ... value ) {
289- // TODO implement
290- throw new UnsupportedOperationException ( );
269+ @ SuppressWarnings ( "unchecked" )
270+ public final Ix < T > startWith ( T ... values ) {
271+ return concatArray ( fromArray ( values ), this );
291272 }
292273
293- public final Ix < T > endWith ( T ... value ) {
294- // TODO implement
295- throw new UnsupportedOperationException ( );
274+ @ SuppressWarnings ( "unchecked" )
275+ public final Ix < T > endWith ( T ... values ) {
276+ return concatArray ( this , fromArray ( values ) );
296277 }
297278
298279 public final Ix <String > join () {
299- // TODO implement
300- throw new UnsupportedOperationException ();
280+ return join (", " );
301281 }
302282
303283 public final Ix <String > join (CharSequence separator ) {
304- // TODO implement
305- throw new UnsupportedOperationException ();
284+ return new IxJoin <T >(this , separator );
306285 }
307286
308287 public final <R > Ix <R > map (Func1 <? super T , ? extends R > mapper ) {
@@ -515,18 +494,17 @@ public final Ix<Ix<T>> window(int size, int skip) {
515494 throw new UnsupportedOperationException ();
516495 }
517496
518- public final Ix < T > concatWith ( Iterator <? extends T > other ) {
519- // TODO implement
520- throw new UnsupportedOperationException ( );
497+ @ SuppressWarnings ( "unchecked" )
498+ public final Ix < T > concatWith ( Iterable <? extends T > other ) {
499+ return concatArray ( this , other );
521500 }
522501
523- public final Ix <T > mergeWith (Iterator <? extends T > other ) {
502+ public final Ix <T > mergeWith (Iterable <? extends T > other ) {
524503 return concatWith (other );
525504 }
526505
527- public final <U , R > Ix <R > zipWith (Iterator <U > other , Func2 <? super T , ? super U , ? extends R > zipper ) {
528- // TODO implement
529- throw new UnsupportedOperationException ();
506+ public final <U , R > Ix <R > zipWith (Iterable <U > other , Func2 <? super T , ? super U , ? extends R > zipper ) {
507+ return zip (this , other , zipper );
530508 }
531509
532510 public final Ix <T > orderBy () {
0 commit comments