package cyclops;

import java.util.Deque;
import java.util.List;
import java.util.Queue;
import java.util.Set;
import java.util.SortedSet;
import java.util.stream.Collector;
import java.util.stream.Collectors;

import cyclops.collections.DequeX;
import com.aol.cyclops2.data.collections.extensions.standard.DequeXImpl;
import cyclops.collections.ListX;
import com.aol.cyclops2.data.collections.extensions.standard.ListXImpl;
import cyclops.collections.QueueX;
import com.aol.cyclops2.data.collections.extensions.standard.QueueXImpl;
import cyclops.collections.SetX;
import com.aol.cyclops2.data.collections.extensions.standard.SetXImpl;
import cyclops.collections.SortedSetX;
import com.aol.cyclops2.data.collections.extensions.standard.SortedSetXImpl;

/**
 * Collectors for Cyclops Extended Collections
 * 
 * @author johnmcclean
 *
 */
public interface CyclopsCollectors {
    /**
     * @return Collector to QueueX
     */
    static <T> Collector<T, ?, QueueX<T>> toQueueX() {
        return Collectors.collectingAndThen(QueueX.defaultCollector(), (final Queue<T> d) -> new QueueXImpl<>(
                                                                                                              d, QueueX.defaultCollector()));

    }

    /**
     * @return Collector for ListX
     */
    static <T> Collector<T, ?, ListX<T>> toListX() {
        return Collectors.collectingAndThen(ListX.defaultCollector(), (final List<T> d) -> new ListXImpl<>(
                                                                                                           d, ListX.defaultCollector()));

    }

    /**
     * @return Collector for DequeX
     */
    static <T> Collector<T, ?, DequeX<T>> toDequeX() {
        return Collectors.collectingAndThen(DequeX.defaultCollector(), (final Deque<T> d) -> new DequeXImpl<>(
                                                                                                              d, DequeX.defaultCollector()));

    }

    /**
     * @return Collector for SetX
     */
    static <T> Collector<T, ?, SetX<T>> toSetX() {
        return Collectors.collectingAndThen(SetX.defaultCollector(), (final Set<T> d) -> new SetXImpl<>(
                                                                                                        d, SetX.defaultCollector()));
    }

    /**
     * @return Collector for SortedSetX
     */
    static <T> Collector<T, ?, SortedSetX<T>> toSortedSetX() {
        return Collectors.collectingAndThen(SortedSetX.defaultCollector(), (final SortedSet<T> d) -> new SortedSetXImpl<>(
                                                                                                                          d,
                                                                                                                          SortedSetX.defaultCollector()));

    }
}

@@ -208,43 +208,8 @@
 s;%0A%0A
-import cyclops.collections.DequeX;%0A
 impo
@@ -260,27 +260,14 @@
 ons.
-standard.DequeXImpl
+lazy.*
 ;%0Aim
@@ -295,23 +295,25 @@
 ons.
-List
+Deque
 X;%0A
+%0A
 import c
 om.a
@@ -312,399 +312,144 @@
 rt c
-om.aol.cyclops2.data.collections.extensions.standard.ListXImpl;%0Aimport cyclops.collections.QueueX;%0Aimport com.aol.cyclops2.data.collections.extensions.standard.QueueXImpl;%0Aimport cyclops.collections.SetX;%0Aimport com.aol.cyclops2.data.collections.extensions.standard.SetXImpl;%0Aimport cyclops.collections.SortedSetX;%0Aimport com.aol.cyclops2.data.collections.extensions.standard.SortedSetXImpl;
+yclops.collections.ListX;%0A%0Aimport cyclops.collections.QueueX;%0A%0Aimport cyclops.collections.SetX;%0A%0Aimport cyclops.collections.SortedSetX;%0A
 %0A%0A/*
@@ -775,18 +775,18 @@
 new 
+Lazy
 QueueX
-Impl
 %3C%3E(%0A
@@ -1139,17 +1139,18 @@
 ew L
-istXImpl%3C
+azyListX%3CT
 %3E(%0A 
@@ -1258,16 +1258,21 @@
      d, 
+null,
 ListX.de
@@ -1507,18 +1507,18 @@
 new 
+Lazy
 DequeX
-Impl
 %3C%3E(%0A
@@ -1861,24 +1861,24 @@
  -%3E new 
+Lazy
 SetX
-Impl
 %3C%3E(%0A    
@@ -2238,16 +2238,20 @@
  -%3E new 
+Lazy
 SortedSe
@@ -2256,12 +2256,8 @@
 SetX
-Impl
 %3C%3E(%0A

fix compile error