diff --git a/htroot/Supporter.java b/htroot/Supporter.java
index 8ed8faa25..2abcabb14 100644
--- a/htroot/Supporter.java
+++ b/htroot/Supporter.java
@@ -34,8 +34,8 @@ import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.cora.ranking.ConcurrentScoreMap;
-import net.yacy.cora.ranking.ScoreMap;
+import net.yacy.cora.sorting.ConcurrentScoreMap;
+import net.yacy.cora.sorting.ScoreMap;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry;
diff --git a/htroot/Surftips.java b/htroot/Surftips.java
index 9c5e9eeb5..fedae9b06 100644
--- a/htroot/Surftips.java
+++ b/htroot/Surftips.java
@@ -33,8 +33,8 @@ import java.util.Iterator;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.cora.ranking.ConcurrentScoreMap;
-import net.yacy.cora.ranking.ScoreMap;
+import net.yacy.cora.sorting.ConcurrentScoreMap;
+import net.yacy.cora.sorting.ScoreMap;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry;
diff --git a/htroot/api/termlist_p.java b/htroot/api/termlist_p.java
index 4cc86a547..4c3259535 100644
--- a/htroot/api/termlist_p.java
+++ b/htroot/api/termlist_p.java
@@ -27,7 +27,7 @@ import java.util.Iterator;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.cora.ranking.Rating;
+import net.yacy.cora.sorting.Rating;
import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
diff --git a/htroot/yacy/search.java b/htroot/yacy/search.java
index e7db51239..580142489 100644
--- a/htroot/yacy/search.java
+++ b/htroot/yacy/search.java
@@ -41,9 +41,9 @@ import net.yacy.cora.document.RSSMessage;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.cora.ranking.ScoreMap;
-import net.yacy.cora.ranking.WeakPriorityBlockingQueue;
import net.yacy.cora.services.federated.yacy.CacheStrategy;
+import net.yacy.cora.sorting.ScoreMap;
+import net.yacy.cora.sorting.WeakPriorityBlockingQueue;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceFactory;
diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.java
index ec5fd48a0..d7522b6fb 100644
--- a/htroot/yacysearchtrailer.java
+++ b/htroot/yacysearchtrailer.java
@@ -27,7 +27,7 @@
import java.util.Iterator;
import net.yacy.cora.protocol.RequestHeader;
-import net.yacy.cora.ranking.ScoreMap;
+import net.yacy.cora.sorting.ScoreMap;
import net.yacy.document.LibraryProvider;
import net.yacy.kelondro.util.EventTracker;
import net.yacy.kelondro.util.Formatter;
diff --git a/source/de/anomic/crawler/Balancer.java b/source/de/anomic/crawler/Balancer.java
index 3e27dd0cc..8afb9eb6a 100644
--- a/source/de/anomic/crawler/Balancer.java
+++ b/source/de/anomic/crawler/Balancer.java
@@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentMap;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.services.federated.yacy.CacheStrategy;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.index.BufferedObjectIndex;
@@ -49,7 +50,6 @@ import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.RowSpaceExceededException;
import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.order.Base64Order;
-import net.yacy.kelondro.order.CloneableIterator;
import net.yacy.kelondro.table.Table;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.kelondro.util.MemoryControl;
diff --git a/source/de/anomic/crawler/ResultURLs.java b/source/de/anomic/crawler/ResultURLs.java
index 78e63db13..3a96a6237 100644
--- a/source/de/anomic/crawler/ResultURLs.java
+++ b/source/de/anomic/crawler/ResultURLs.java
@@ -34,8 +34,8 @@ import java.util.concurrent.ConcurrentHashMap;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
-import net.yacy.cora.ranking.ClusteredScoreMap;
-import net.yacy.cora.ranking.ScoreMap;
+import net.yacy.cora.sorting.ClusteredScoreMap;
+import net.yacy.cora.sorting.ScoreMap;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataRow;
import net.yacy.kelondro.logging.Log;
diff --git a/source/de/anomic/data/DidYouMean.java b/source/de/anomic/data/DidYouMean.java
index c8de2f564..e6ae07c8f 100644
--- a/source/de/anomic/data/DidYouMean.java
+++ b/source/de/anomic/data/DidYouMean.java
@@ -7,8 +7,8 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.LinkedBlockingQueue;
-import net.yacy.cora.ranking.ClusteredScoreMap;
-import net.yacy.cora.ranking.ReversibleScoreMap;
+import net.yacy.cora.sorting.ClusteredScoreMap;
+import net.yacy.cora.sorting.ReversibleScoreMap;
import net.yacy.document.LibraryProvider;
import net.yacy.document.StringBuilderComparator;
import net.yacy.kelondro.data.word.Word;
diff --git a/source/de/anomic/data/UserDB.java b/source/de/anomic/data/UserDB.java
index f7bfae34b..a794cc995 100644
--- a/source/de/anomic/data/UserDB.java
+++ b/source/de/anomic/data/UserDB.java
@@ -37,12 +37,12 @@ import java.util.Map;
import java.util.Random;
import net.yacy.cora.document.UTF8;
+import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.kelondro.blob.MapHeap;
import net.yacy.kelondro.index.RowSpaceExceededException;
import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.order.Base64Order;
-import net.yacy.kelondro.order.CloneableIterator;
import net.yacy.kelondro.order.Digest;
import net.yacy.kelondro.order.NaturalOrder;
import net.yacy.kelondro.util.FileUtils;
diff --git a/source/net/yacy/cora/lod/Node.java b/source/net/yacy/cora/lod/Node.java
index 2de6fe11e..60f2026e2 100644
--- a/source/net/yacy/cora/lod/Node.java
+++ b/source/net/yacy/cora/lod/Node.java
@@ -1,7 +1,31 @@
+/**
+ * AbstractScoreMap
+ * Copyright 2011 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
+ * First released 16.12.2011 at http://yacy.net
+ *
+ * $LastChangedDate: 2011-04-14 00:04:23 +0200 (Do, 14 Apr 2011) $
+ * $LastChangedRevision: 7653 $
+ * $LastChangedBy: orbiter $
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program in the file lgpl21.txt
+ * If not, see .
+ */
+
package net.yacy.cora.lod;
-import java.util.Map;
import java.util.HashMap;
+import java.util.Map;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.lod.vocabulary.Vocabulary;
diff --git a/source/net/yacy/cora/lod/TripleStore.java b/source/net/yacy/cora/lod/TripleStore.java
index 8c39307ed..43b22f0bf 100644
--- a/source/net/yacy/cora/lod/TripleStore.java
+++ b/source/net/yacy/cora/lod/TripleStore.java
@@ -1,12 +1,37 @@
+/**
+ * TripleStore
+ * Copyright 2011 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
+ * First released 16.12.2011 at http://yacy.net
+ *
+ * $LastChangedDate: 2011-04-14 00:04:23 +0200 (Do, 14 Apr 2011) $
+ * $LastChangedRevision: 7653 $
+ * $LastChangedBy: orbiter $
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program in the file lgpl21.txt
+ * If not, see .
+ */
+
+
package net.yacy.cora.lod;
import java.util.AbstractMap;
import java.util.Iterator;
import java.util.Map;
-import net.yacy.kelondro.blob.MapStore;
-import net.yacy.kelondro.order.ByteOrder;
-import net.yacy.kelondro.order.CloneableIterator;
+import net.yacy.cora.order.ByteOrder;
+import net.yacy.cora.order.CloneableIterator;
+import net.yacy.cora.storage.MapStore;
public class TripleStore {
@@ -84,7 +109,7 @@ public class TripleStore {
}
public ByteOrder getOrdering() {
- return store.getOrdering();
+ return this.store.getOrdering();
}
public CloneableIterator idIterator() {
diff --git a/source/net/yacy/cora/ranking/AbstractOrder.java b/source/net/yacy/cora/order/AbstractOrder.java
similarity index 98%
rename from source/net/yacy/cora/ranking/AbstractOrder.java
rename to source/net/yacy/cora/order/AbstractOrder.java
index cbc74d556..239d5efd2 100644
--- a/source/net/yacy/cora/ranking/AbstractOrder.java
+++ b/source/net/yacy/cora/order/AbstractOrder.java
@@ -22,7 +22,8 @@
* If not, see .
*/
-package net.yacy.cora.ranking;
+package net.yacy.cora.order;
+
public abstract class AbstractOrder implements Order {
diff --git a/source/net/yacy/cora/order/ByteOrder.java b/source/net/yacy/cora/order/ByteOrder.java
new file mode 100644
index 000000000..b7fc41f12
--- /dev/null
+++ b/source/net/yacy/cora/order/ByteOrder.java
@@ -0,0 +1,52 @@
+/**
+ * ByteOrder
+ * (C) 2008 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
+ * first published 10.01.2008 on http://yacy.net
+ *
+ * $LastChangedDate$
+ * $LastChangedRevision$
+ * $LastChangedBy$
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program in the file lgpl21.txt
+ * If not, see .
+ */
+
+package net.yacy.cora.order;
+
+
+public interface ByteOrder extends Order {
+
+ @Override
+ public boolean wellformed(byte[] a);
+
+ public boolean wellformed(byte[] a, int start, int len);
+
+ @Override
+ public int compare(byte[] a, byte[] b);
+
+ public int compare(byte[] a, byte[] b, int len);
+
+ public int compare(byte[] a, int astart, byte[] b, int bstart, int len);
+
+ @Override
+ public boolean equal(final byte[] a, final byte[] b);
+
+ public boolean equal(final byte[] a, int astart, final byte[] b, int bstart, int length);
+
+ public long cardinal(final byte[] a, int off, int len);
+
+ public byte[] smallest(byte[] a, byte[] b);
+
+ public byte[] largest(byte[] a, byte[] b);
+}
diff --git a/source/net/yacy/cora/order/CloneableIterator.java b/source/net/yacy/cora/order/CloneableIterator.java
new file mode 100644
index 000000000..001e48694
--- /dev/null
+++ b/source/net/yacy/cora/order/CloneableIterator.java
@@ -0,0 +1,35 @@
+/**
+ * ByteOrder
+ * (C) 2008 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
+ * first published 10.01.2008 on http://yacy.net
+ *
+ * $LastChangedDate$
+ * $LastChangedRevision$
+ * $LastChangedBy$
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program in the file lgpl21.txt
+ * If not, see .
+ */
+
+package net.yacy.cora.order;
+
+import java.util.Iterator;
+
+public interface CloneableIterator extends Iterator {
+
+ // clone the iterator using a modifier
+ // the modifier can be i.e. a re-start position
+ public CloneableIterator clone(Object modifier);
+
+}
diff --git a/source/net/yacy/cora/order/CloneableMapIterator.java b/source/net/yacy/cora/order/CloneableMapIterator.java
new file mode 100644
index 000000000..9ba736c91
--- /dev/null
+++ b/source/net/yacy/cora/order/CloneableMapIterator.java
@@ -0,0 +1,84 @@
+/**
+ * ByteOrder
+ * (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
+ * first published 25.04.2007 on http://yacy.net
+ *
+ * $LastChangedDate$
+ * $LastChangedRevision$
+ * $LastChangedBy$
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program in the file lgpl21.txt
+ * If not, see .
+ */
+
+package net.yacy.cora.order;
+
+import java.util.Iterator;
+import java.util.TreeMap;
+
+
+
+public class CloneableMapIterator implements CloneableIterator {
+
+ TreeMap map;
+ E next, last;
+ Object start;
+ Iterator iter;
+
+
+ public CloneableMapIterator(final TreeMap map, final E start) {
+ // map must contain eiter a byte[]/Object or a String/Object mapping.
+ // start must be either of type byte[] or String
+ // this iterator iterates then only the key elements of the map
+ this.map = map;
+ this.start = start;
+ this.iter = map.keySet().iterator();
+ if (this.start == null) {
+ if (this.iter.hasNext()) this.next = this.iter.next(); else this.next = null;
+ } else while (this.iter.hasNext()) {
+ this.next = this.iter.next();
+ if (map.comparator().compare(this.next, start) > 1) break;
+ }
+ this.last = null;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public CloneableMapIterator clone(final Object modifier) {
+ return new CloneableMapIterator(this.map, (E) modifier);
+ }
+
+ @Override
+ public boolean hasNext() {
+ return this.next != null;
+ }
+
+ @Override
+ public E next() {
+ // returns key-elements, not entry-elements
+ this.last = this.next;
+ if (this.iter.hasNext()) {
+ this.next = this.iter.next();
+ } else {
+ this.next = null;
+ }
+ return this.last;
+ }
+
+ @Override
+ public void remove() {
+ this.map.remove(this.last);
+ }
+
+}
diff --git a/source/net/yacy/cora/ranking/Order.java b/source/net/yacy/cora/order/Order.java
similarity index 98%
rename from source/net/yacy/cora/ranking/Order.java
rename to source/net/yacy/cora/order/Order.java
index 6b66cd157..35752f4ec 100644
--- a/source/net/yacy/cora/ranking/Order.java
+++ b/source/net/yacy/cora/order/Order.java
@@ -22,7 +22,7 @@
* If not, see .
*/
-package net.yacy.cora.ranking;
+package net.yacy.cora.order;
import java.util.Comparator;
diff --git a/source/net/yacy/cora/order/RatingOrder.java b/source/net/yacy/cora/order/RatingOrder.java
new file mode 100644
index 000000000..95b6cb64c
--- /dev/null
+++ b/source/net/yacy/cora/order/RatingOrder.java
@@ -0,0 +1,69 @@
+/**
+ * RatingOrder.java
+ * Copyright 2011 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
+ * First released 25.08.2011 at http://yacy.net
+ *
+ * $LastChangedDate: 2011-04-14 00:04:23 +0200 (Do, 14 Apr 2011) $
+ * $LastChangedRevision: 7653 $
+ * $LastChangedBy: orbiter $
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program in the file lgpl21.txt
+ * If not, see .
+ */
+
+
+package net.yacy.cora.order;
+
+import net.yacy.cora.sorting.Rating;
+
+
+
+public class RatingOrder extends AbstractOrder> implements Order> {
+
+ Order ordering;
+
+ public RatingOrder(final Order ordering) {
+ this.ordering = ordering;
+ }
+
+ @Override
+ public int compare(final Rating a, final Rating b) {
+ return this.ordering.compare(a.getObject(), b.getObject());
+ }
+
+ @Override
+ public boolean wellformed(final Rating a) {
+ return true;
+ }
+
+ @Override
+ public String signature() {
+ return "RA";
+ }
+
+ @Override
+ public long cardinal(final Rating key) {
+ return key.getScore();
+ }
+
+ @Override
+ public boolean equal(final Rating a, final Rating b) {
+ return this.ordering.compare(a.getObject(), b.getObject()) == 1;
+ }
+
+ @Override
+ public Order> clone() {
+ return this;
+ }
+}
diff --git a/source/net/yacy/cora/ranking/RatingOrder.java b/source/net/yacy/cora/ranking/RatingOrder.java
deleted file mode 100644
index 5d85680ba..000000000
--- a/source/net/yacy/cora/ranking/RatingOrder.java
+++ /dev/null
@@ -1,66 +0,0 @@
-// RatingOrder.java
-// -----------------------
-// (C) by Michael Peter Christen; mc@yacy.net
-// first published on http://yacy.net
-// Frankfurt, Germany, 2011
-// created 25.08.2011
-//
-// $LastChangedDate: 2011-03-08 02:51:51 +0100 (Di, 08 Mrz 2011) $
-// $LastChangedRevision: 7567 $
-// $LastChangedBy: low012 $
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-package net.yacy.cora.ranking;
-
-
-public class RatingOrder extends AbstractOrder> implements Order> {
-
- Order ordering;
-
- public RatingOrder(final Order ordering) {
- this.ordering = ordering;
- }
-
- public int compare(final Rating a, final Rating b) {
- return this.ordering.compare(a.getObject(), b.getObject());
- }
-
- @Override
- public boolean wellformed(final Rating a) {
- return true;
- }
-
- @Override
- public String signature() {
- return "RA";
- }
-
- @Override
- public long cardinal(final Rating key) {
- return key.getScore();
- }
-
- @Override
- public boolean equal(final Rating a, final Rating b) {
- return this.ordering.compare(a.getObject(), b.getObject()) == 1;
- }
-
- @Override
- public Order> clone() {
- return this;
- }
-}
diff --git a/source/net/yacy/cora/services/federated/SearchHub.java b/source/net/yacy/cora/services/federated/SearchHub.java
index de74ff40c..7394a0225 100644
--- a/source/net/yacy/cora/services/federated/SearchHub.java
+++ b/source/net/yacy/cora/services/federated/SearchHub.java
@@ -32,10 +32,10 @@ import java.util.concurrent.ConcurrentHashMap;
import net.yacy.cora.document.RSSMessage;
import net.yacy.cora.protocol.http.HTTPClient;
-import net.yacy.cora.ranking.ConcurrentScoreMap;
-import net.yacy.cora.ranking.ScoreMap;
import net.yacy.cora.services.federated.opensearch.SRURSSConnector;
import net.yacy.cora.services.federated.yacy.CacheStrategy;
+import net.yacy.cora.sorting.ConcurrentScoreMap;
+import net.yacy.cora.sorting.ScoreMap;
public class SearchHub {
diff --git a/source/net/yacy/cora/services/federated/SearchResult.java b/source/net/yacy/cora/services/federated/SearchResult.java
index 820f0e6b6..c0c9e19dd 100644
--- a/source/net/yacy/cora/services/federated/SearchResult.java
+++ b/source/net/yacy/cora/services/federated/SearchResult.java
@@ -26,7 +26,7 @@
package net.yacy.cora.services.federated;
-import net.yacy.cora.ranking.WeakPriorityBlockingQueue;
+import net.yacy.cora.sorting.WeakPriorityBlockingQueue;
public class SearchResult extends WeakPriorityBlockingQueue