Ranides Atterwim 9 роки тому
батько
коміт
66b5dc9775

+ 9 - 0
.idea/codeStyleSettings.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectCodeStyleSettingsManager">
+    <option name="PER_PROJECT_SETTINGS">
+      <value />
+    </option>
+    <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default (1)" />
+  </component>
+</project>

+ 124 - 0
.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 2 - 2
assira.drafts/assira.drafts.iml

@@ -21,9 +21,9 @@
     <orderEntry type="library" name="Maven: se.fishtank:css-selectors:2.0" level="project" />
     <orderEntry type="library" name="Maven: commons-net:commons-net:3.4" level="project" />
     <orderEntry type="module-library">
-      <library name="Maven: com.sun:tools:1.8.0_101">
+      <library name="Maven: com.sun:tools:1.8.0_112-release">
         <CLASSES>
-          <root url="jar://C:/Program Files/Java/jdk1.8.0_101/lib/tools.jar!/" />
+          <root url="jar://C:/Program Files/Java/jdk1.8.0_101/jre/../lib/tools.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />

+ 0 - 58
assira.drafts/src/main/java/net/ranides/assira/collections/map/IndexMap.java

@@ -1,58 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/assira.drafts
- */
-package net.ranides.assira.collections.map;
-
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.function.Consumer;
-import java.util.function.Function;
-
-/**
- *
- * @author Ranides Atterwim <ranides@gmail.com>
- */
-public interface IndexMap<V> {
-
-    IndexMap<V> index(String name, Comparator<V> index);
-    
-    <T> IndexMap<V> index(String name, Function<V,T> index);
-    
-    
-    
-    IndexQuery<V> find();
-
-    IndexQuery<V> find(Comparator<V> index, V value);
-    
-    <T> IndexQuery<V> find(Function<V,T> index, T value);
-
-    IndexQuery<V> find(String index, V value);
-
-    
-    
-    void put(V value);
-
-    void put(Collection<? extends V> values);
-
-    void update(V value, Consumer<? super V> consumer);
-    
-    void updateAll();
-    
-    
-    
-    void remove(Comparator<V> index, V value);
-    
-    <T> void remove(Function<V,T> index, T value);
-
-    void remove(String index, V value);
-    
-    void remove(V value);
-    
-    void removeAll(Collection<V> values);
-
-    void clear();
-
-}

+ 0 - 57
assira.drafts/src/main/java/net/ranides/assira/collections/map/IndexQuery.java

@@ -1,57 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/assira.drafts
- */
-package net.ranides.assira.collections.map;
-
-import java.util.Comparator;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import net.ranides.assira.collection.query.CQuery;
-
-/**
- *
- * @author Ranides Atterwim <ranides@gmail.com>
- */
-public interface IndexQuery<V> extends CQuery<V> {
-    
-
-    IndexQuery<V> eq(Comparator<V> index, V value);
-    
-    <T> IndexQuery<V> eq(Function<V,T> index, T value);
-
-    IndexQuery<V> eq(String index, Object value);
-    
-
-    
-    IndexQuery<V> gt(Comparator<V> index, V value);
-    
-    <T> IndexQuery<V> gt(Function<V,T> index, T value);
-
-    IndexQuery<V> gt(String index, Object value);
-    
-    
-    
-    IndexQuery<V> lt(Comparator<V> index, V value);
-    
-    <T> IndexQuery<V> lt(Function<V,T> index, T value);
-
-    IndexQuery<V> lt(String index, Object value);
-    
-    
-
-    IndexQuery<V> in(Comparator<V> index, V begin, V end);
-    
-    <T> IndexQuery<V> in(Function<V,T> index, T begin, T end);
-
-    IndexQuery<V> in(String index, Object begin, Object end);
-
-    
-    
-    void remove();
-
-    void update(Consumer<? super V> consumer);
-    
-}

+ 0 - 81
assira.drafts/src/main/java/net/ranides/assira/collections/map/impl/AIndexMap.java

@@ -1,81 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/assira.drafts
- */
-package net.ranides.assira.collections.map.impl;
-
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import net.ranides.assira.collections.map.IndexMap;
-import net.ranides.assira.collections.map.IndexQuery;
-
-/**
- *
- * @author Ranides Atterwim <ranides@gmail.com>
- */
-public abstract class AIndexMap<V> implements IndexMap<V> {
-
-    @Override
-    public abstract AIndexQuery<V> find();
-    
-    @Override
-    public final IndexQuery<V> find(Comparator<V> index, V value) {
-        return find().eq(index, value);
-    }
-
-    @Override
-    public <T> IndexQuery<V> find(Function<V, T> index, T value) {
-        return find().eq(index, value);
-    }
-    
-    @SuppressWarnings("unchecked")
-    @Override
-    public final IndexQuery<V> find(String index, Object value) {
-        return find().eq(index, value);
-    }
-    
-    @Override
-    public final void put(Collection<? extends V> values) {
-        for(V value : values) {
-            put(value);
-        }
-    }
-    
-    @Override
-    public final void remove(Comparator<V> index, V value) {
-        find().eq(index, value).remove();
-    }
-
-    @Override
-    public <T> void remove(Function<V, T> index, T value) {
-        find().eq(index, value).remove();
-    }
-    
-    @Override
-    public final void remove(String index, Object value) {
-        find().eq(index, value).remove();
-    }
-
-    @Override
-    public void removeAll(Collection<V> values) {
-        for(V item : values) {
-            remove(item);
-        }
-    }
-    
-    @Override
-    public void update(V value, Consumer<? super V> consumer) {
-        remove(value);
-        consumer.accept(value);
-        put(value);
-    }
-    
-    protected abstract <T> Function<V,T> mindex(String name);
-    
-    protected abstract Comparator<V> sindex(String name);
-    
-}

+ 0 - 70
assira.drafts/src/main/java/net/ranides/assira/collections/map/impl/AIndexQuery.java

@@ -1,70 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/assira.drafts
- */
-package net.ranides.assira.collections.map.impl;
-
-import java.util.Collection;
-import java.util.Comparator;
-import net.ranides.assira.collections.map.IndexQuery;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import net.ranides.assira.collection.query.CQueryAbstract;
-
-/**
- *
- * @author Ranides Atterwim <ranides@gmail.com>
- */
-public abstract class AIndexQuery<V> extends CQueryAbstract<V> implements IndexQuery<V> {
-    
-    protected abstract AIndexMap<V> parent();
-    
-    @SuppressWarnings("unchecked")
-    @Override
-    public final IndexQuery<V> eq(String index, Object value) {
-        return filter(index, a -> eq(a,value), a -> eq(a,(V)value));
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public final IndexQuery<V> lt(String index, Object value) {
-        return filter(index, a -> lt(a,value), a -> lt(a,(V)value));
-    }
-    
-    @SuppressWarnings("unchecked")
-    @Override
-    public final IndexQuery<V> gt(String index, Object value) {
-        return filter(index, a -> gt(a,value), a -> gt(a,(V)value));
-    }
-    
-    @SuppressWarnings("unchecked")
-    @Override
-    public final IndexQuery<V> in(String index, Object begin, Object end) {
-        return filter(index, a -> in(a,begin,end), a -> in(a,(V)begin,(V)end));
-    }
-    
-    @Override
-    public void update(Consumer<? super V> consumer) {
-        select().forEach(v -> parent().update(v, consumer));
-    }
-    
-    protected abstract Collection<V> select();
-    
-    private IndexQuery<V> filter(
-            String index, 
-            Function<Function<V, Object>, IndexQuery<V>> mf, 
-            Function<Comparator<V>, IndexQuery<V>> sf
-    ) {
-        Function<V, Object> mi = parent().mindex(index);
-        if(mi != null) {
-            return mf.apply(mi);
-        }
-        Comparator<V> si = parent().sindex(index);
-        if(si != null) {
-            return sf.apply(si);
-        }
-        throw new IllegalArgumentException("Unknown index: " + index);
-    }
-}

+ 0 - 327
assira.drafts/src/main/java/net/ranides/assira/collections/map/impl/CIndexTreeMap.java

@@ -1,327 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/assira.drafts
- */
-package net.ranides.assira.collections.map.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.SortedMap;
-import java.util.SortedSet;
-import java.util.function.Function;
-import java.util.function.Supplier;
-import java.util.stream.Stream;
-import net.ranides.assira.collection.maps.ASortedMap;
-import net.ranides.assira.collection.maps.RBTreeMultiMap;
-import net.ranides.assira.collection.sets.ASortedSet;
-import net.ranides.assira.collection.sets.RBTreeMultiSet;
-
-import net.ranides.assira.collections.map.IndexMap;
-import net.ranides.assira.collections.map.IndexQuery;
-import net.ranides.assira.generic.CompareUtils;
-
-/**
- *
- * @author Ranides Atterwim <ranides@gmail.com>
- */
-public class CIndexTreeMap<V> extends AIndexMap<V> {
-    
-    private final Map<String, Comparator> name2sindex = new HashMap<>();
-    
-    private final Map<String, Function> name2mindex = new HashMap<>();
-    
-    private final Map<Comparator, RBTreeMultiSet<V>> cindexes = new HashMap<>();
-    
-    private final Map<Function, RBTreeMultiMap<Object, V>> mindexes = new HashMap<>();
-
-    @Override
-    public IndexMap<V> index(String name, Comparator<V> index) {
-        RBTreeMultiSet<V> set = new RBTreeMultiSet<>(index);
-        cindexes.put(index, set);
-        name2sindex.put(name, index);
-        for(V item : values()) {
-            set.add(item);
-        }
-        return this;
-    }
-
-    @Override
-    public <T> IndexMap<V> index(String name, Function<V, T> index) {
-        RBTreeMultiMap<Object,V> map = new RBTreeMultiMap<>();
-        mindexes.put(index, map);
-        name2mindex.put(name, index);
-        for(V item : values()) {
-            map.put(index.apply(item),item);
-        }
-        return this;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    protected <T> Function<V, T> mindex(String name) {
-        return name2mindex.get(name);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    protected Comparator<V> sindex(String name) {
-        return name2sindex.get(name);
-    }
-    
-    @Override
-    public void remove(V value) {
-        for(SortedSet<V> index : cindexes.values()) {
-            CIndexTreeMap.this.iremove(index, value);
-        }
-        for(SortedMap<Object,V> index : mindexes.values()) {
-            iremove(index, value);
-        }
-    }
-    
-    private void iremove(SortedSet<V> set, V value) {
-        Comparator<? super V> c = set.comparator();
-        Iterator<V> i = set.headSet(value).iterator();
-        while(i.hasNext()) {
-            V item = i.next();
-            if(c.compare(item, value) !=0) {
-                return;
-            }
-            if(CompareUtils.equals(item,value)) {
-                i.remove();
-                return;
-            }
-        }
-    }
-    
-    private void iremove(SortedMap<Object,V> map, V value) {
-        Comparator<Object> c = CompareUtils.comparator();
-        Iterator<Entry<Object,V>> i = map.headMap(value).entrySet().iterator();
-        while(i.hasNext()) {
-            Entry<Object,V> item = i.next();
-            if(c.compare(item.getKey(), value) !=0) {
-                return;
-            }
-            if(CompareUtils.equals(item.getValue(),value)) {
-                i.remove();
-                return;
-            }
-        }
-    }
-    
-    @SuppressWarnings("unchecked")
-    @Override
-    public void updateAll() {
-        List<V> items = new ArrayList<>(values());
-        for(SortedSet<V> index : cindexes.values()) {
-            index.clear();
-            index.addAll(items);
-        }
-        for(Entry<Function, RBTreeMultiMap<Object,V>> entry : mindexes.entrySet()) {
-            Function fun = entry.getKey();
-            RBTreeMultiMap<Object, V> index = entry.getValue();
-            index.clear();
-            for(V item : items) {
-                index.put(fun.apply(item), item);
-            }
-        }
-    }
-
-    
-    @Override
-    public AIndexQuery<V> find() {
-        return new CHQuery();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public void put(V value) {
-        for(SortedSet<V> index : cindexes.values()) {
-            index.add(value);
-        }
-        for(Entry<Function, RBTreeMultiMap<Object,V>> entry : mindexes.entrySet()) {
-            Function fun = entry.getKey();
-            RBTreeMultiMap<Object, V> index = entry.getValue();
-            index.put(fun.apply(value), value);
-        }
-    }
-
-    @Override
-    public void clear() {
-        for(SortedSet<V> index : cindexes.values()) {
-            index.clear();
-        }
-    }
-    
-    private Collection<V> values() {
-        if(cindexes.isEmpty()) {
-            return Collections.emptySet();
-        }
-        return cindexes.values().iterator().next();
-    }
-
-    private static Object after(ASortedMap<Object, ?> map, Object value) {
-        Comparator<Object> cmp = CompareUtils.comparator();
-        Iterator<Object> i = map.keySet().iterator(value);
-        while(i.hasNext()) {
-            Object next = i.next();
-            if(cmp.compare(value, next)!=0) {
-                return next;
-            }
-        }
-        return null;
-    }
-    
-    private static <T> T after(ASortedSet<T> set, T value) {
-        Comparator<? super T> cmp = set.comparator();
-        Iterator<T> i = set.iterator(value);
-        while(i.hasNext()) {
-            T next = i.next();
-            if(cmp.compare(value, next)!=0) {
-                return next;
-            }
-        }
-        return null;
-    }
-    
-    private final class CHQuery extends AIndexQuery<V> {
-        
-        private final List<Supplier<Collection<V>>> selectors;
-
-        public CHQuery() {
-            this.selectors = Collections.emptyList();
-        }
-        
-        public CHQuery(CHQuery query, Supplier<Collection<V>> selector) {
-            this.selectors = new ArrayList<>(query.selectors.size()+1);
-            this.selectors.addAll(query.selectors);
-            this.selectors.add(selector);
-        }
-        
-        @Override
-        protected AIndexMap<V> parent() {
-            return CIndexTreeMap.this;
-        }
-
-        @Override
-        public Stream<V> stream() {
-            return select().stream();
-        }
-
-        @Override
-        public int size() {
-            return select().size();
-        }
-
-        @Override
-        public Iterator<V> iterator() {
-            return select().iterator();
-        }
-
-        @Override
-        public IndexQuery<V> eq(Comparator<V> index, V value) {
-            return new CHQuery(this, () -> cindexes.get(index).getAll(value));
-        }
-
-        @Override
-        public <T> IndexQuery<V> eq(Function<V, T> index, T value) {
-            return new CHQuery(this, () -> mindexes.get(index).getAll(value));
-        }
-
-        @Override
-        public IndexQuery<V> gt(Comparator<V> index, V value) {
-            ASortedSet<V> set = cindexes.get(index);
-            return new CHQuery(this, () -> {
-                V last = after(set,value);
-                return last==null ? Collections.emptyList() : set.tailSet(last);
-            });
-        }
-
-        @Override
-        public <T> IndexQuery<V> gt(Function<V, T> index, T value) {
-            RBTreeMultiMap<Object, V> map = mindexes.get(index);
-            return new CHQuery(this, () -> {
-                Object last = after(map,value);
-                return last==null ? Collections.emptyList() : map.tailMap(last).values();
-            });
-        }
-
-        @Override
-        public IndexQuery<V> lt(Comparator<V> index, V value) {
-            return new CHQuery(this, () -> cindexes.get(index).headSet(value));
-        }
-
-        @Override
-        public <T> IndexQuery<V> lt(Function<V, T> index, T value) {
-            return new CHQuery(this, () -> mindexes.get(index).headMap(value).values());
-        }
-
-        @Override
-        public IndexQuery<V> in(Comparator<V> index, V begin, V end) {
-            return new CHQuery(this, () -> cindexes.get(index).subSet(begin, end));
-        }
-
-        @Override
-        public <T> IndexQuery<V> in(Function<V, T> index, T begin, T end) {
-            return new CHQuery(this, () -> mindexes.get(index).subMap(begin, end).values());
-        }
-
-        @Override
-        public void remove() {
-            removeAll(select());
-        }
-        
-        @Override
-        protected Collection<V> select() {
-            int psize = 0;
-            Collection<V> prim = null;
-            List<Collection<V>> sec = new ArrayList<>(selectors.size()-1);
-            for(Supplier<Collection<V>> s : selectors) {
-                Collection<V> c = s.get();
-                int csize = c.size();
-                
-                if(psize > csize) {
-                    sec.add(prim);
-                    prim = null;
-                }
-                if(prim==null) {
-                    prim = c;
-                    psize = csize;
-                } else {
-                    sec.add(c);
-                }
-            }
-            
-            if(prim==null) {
-                return Collections.emptyList();
-            }
-            
-            List<V> out = new ArrayList<>(prim.size());
-            for(V item : prim) {
-                if(selected(sec,item)) {
-                    out.add(item);
-                }
-            }
-            return out;
-        }
-        
-        private boolean selected(List<Collection<V>> sec, V item) {
-            for(Collection<V> s : sec) {
-                if(!s.contains(item)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-        
-    }
-    
-}