From c04bfaa51b12d83ba5d0b99569c171e1eab38f71 Mon Sep 17 00:00:00 2001 From: Michael Christen Date: Fri, 16 Dec 2011 23:59:29 +0100 Subject: [PATCH] refactoring --- htroot/Supporter.java | 4 +- htroot/Surftips.java | 4 +- htroot/api/termlist_p.java | 2 +- htroot/yacy/search.java | 4 +- htroot/yacysearchtrailer.java | 2 +- source/de/anomic/crawler/Balancer.java | 2 +- source/de/anomic/crawler/ResultURLs.java | 4 +- source/de/anomic/data/DidYouMean.java | 4 +- source/de/anomic/data/UserDB.java | 2 +- source/net/yacy/cora/lod/Node.java | 26 +++++- source/net/yacy/cora/lod/TripleStore.java | 33 +++++++- .../{ranking => order}/AbstractOrder.java | 3 +- source/net/yacy/cora/order/ByteOrder.java | 52 ++++++++++++ .../yacy/cora/order/CloneableIterator.java | 35 ++++++++ .../yacy/cora/order/CloneableMapIterator.java | 84 +++++++++++++++++++ .../yacy/cora/{ranking => order}/Order.java | 2 +- source/net/yacy/cora/order/RatingOrder.java | 69 +++++++++++++++ source/net/yacy/cora/ranking/RatingOrder.java | 66 --------------- .../cora/services/federated/SearchHub.java | 4 +- .../cora/services/federated/SearchResult.java | 2 +- .../AbstractScoreMap.java | 2 +- .../ClusteredScoreMap.java | 2 +- .../ConcurrentScoreMap.java | 2 +- .../{ranking => sorting}/OrderedScoreMap.java | 2 +- .../cora/{ranking => sorting}/Rating.java | 2 +- .../ReversibleScoreMap.java | 2 +- .../{ranking => sorting}/ScoreComparator.java | 2 +- .../cora/{ranking => sorting}/ScoreMap.java | 2 +- .../WeakPriorityBlockingQueue.java | 2 +- .../storage}/AbstractMapStore.java | 49 ++++++----- source/net/yacy/cora/storage/MapStore.java | 56 +++++++++++++ source/net/yacy/dbtest.java | 2 +- source/net/yacy/document/WordCache.java | 2 +- .../document/parser/html/ContentScraper.java | 2 +- .../yacy/document/parser/html/Evaluation.java | 2 +- source/net/yacy/kelondro/blob/ArrayStack.java | 4 +- .../net/yacy/kelondro/blob/BEncodedHeap.java | 5 +- .../yacy/kelondro/blob/BEncodedHeapBag.java | 53 ++++++------ .../yacy/kelondro/blob/BEncodedHeapShard.java | 57 +++++++------ source/net/yacy/kelondro/blob/BLOB.java | 4 +- source/net/yacy/kelondro/blob/Compressor.java | 4 +- source/net/yacy/kelondro/blob/Heap.java | 4 +- .../net/yacy/kelondro/blob/HeapModifier.java | 2 +- source/net/yacy/kelondro/blob/HeapReader.java | 4 +- source/net/yacy/kelondro/blob/HeapWriter.java | 2 +- .../net/yacy/kelondro/blob/MapDataMining.java | 10 +-- source/net/yacy/kelondro/blob/MapHeap.java | 4 +- source/net/yacy/kelondro/blob/MapStore.java | 56 ------------- source/net/yacy/kelondro/index/BinSearch.java | 2 +- .../kelondro/index/BufferedObjectIndex.java | 2 +- source/net/yacy/kelondro/index/Cache.java | 2 +- source/net/yacy/kelondro/index/HandleMap.java | 4 +- source/net/yacy/kelondro/index/HandleSet.java | 4 +- source/net/yacy/kelondro/index/Index.java | 2 +- source/net/yacy/kelondro/index/RAMIndex.java | 2 +- .../yacy/kelondro/index/RAMIndexCluster.java | 2 +- source/net/yacy/kelondro/index/Row.java | 6 +- .../yacy/kelondro/index/RowCollection.java | 2 +- source/net/yacy/kelondro/index/RowSet.java | 2 +- .../net/yacy/kelondro/order/Base64Order.java | 5 +- source/net/yacy/kelondro/order/ByteOrder.java | 54 ------------ .../kelondro/order/CloneableIterator.java | 37 -------- .../kelondro/order/CloneableMapIterator.java | 82 ------------------ .../yacy/kelondro/order/MergeIterator.java | 3 +- .../net/yacy/kelondro/order/NaturalOrder.java | 5 +- .../yacy/kelondro/order/RotateIterator.java | 2 + .../yacy/kelondro/order/StackIterator.java | 2 + .../net/yacy/kelondro/order/StringOrder.java | 3 +- .../kelondro/rwi/AbstractBufferedIndex.java | 2 +- .../net/yacy/kelondro/rwi/AbstractIndex.java | 2 +- .../net/yacy/kelondro/rwi/BufferedIndex.java | 2 +- source/net/yacy/kelondro/rwi/Index.java | 6 +- source/net/yacy/kelondro/rwi/IndexCell.java | 8 +- source/net/yacy/kelondro/rwi/IndexReader.java | 2 +- .../yacy/kelondro/rwi/ReferenceContainer.java | 2 +- .../kelondro/rwi/ReferenceContainerArray.java | 6 +- .../kelondro/rwi/ReferenceContainerCache.java | 6 +- .../kelondro/rwi/ReferenceContainerOrder.java | 4 +- .../yacy/kelondro/rwi/ReferenceIterator.java | 2 +- source/net/yacy/kelondro/table/SQLTable.java | 4 +- .../net/yacy/kelondro/table/SplitTable.java | 4 +- source/net/yacy/kelondro/table/Table.java | 2 +- source/net/yacy/kelondro/util/ByteArray.java | 2 +- source/net/yacy/peers/Seed.java | 4 +- source/net/yacy/peers/dht/PeerSelection.java | 4 +- .../yacy/search/index/MetadataRepository.java | 8 +- source/net/yacy/search/index/Segment.java | 2 +- source/net/yacy/search/query/RWIProcess.java | 10 +-- source/net/yacy/search/query/SearchEvent.java | 2 +- .../net/yacy/search/query/SnippetProcess.java | 8 +- source/net/yacy/search/ranking/BlockRank.java | 4 +- .../yacy/search/ranking/ReferenceOrder.java | 2 +- source/net/yacy/yacy.java | 4 +- 93 files changed, 566 insertions(+), 503 deletions(-) rename source/net/yacy/cora/{ranking => order}/AbstractOrder.java (98%) create mode 100644 source/net/yacy/cora/order/ByteOrder.java create mode 100644 source/net/yacy/cora/order/CloneableIterator.java create mode 100644 source/net/yacy/cora/order/CloneableMapIterator.java rename source/net/yacy/cora/{ranking => order}/Order.java (98%) create mode 100644 source/net/yacy/cora/order/RatingOrder.java delete mode 100644 source/net/yacy/cora/ranking/RatingOrder.java rename source/net/yacy/cora/{ranking => sorting}/AbstractScoreMap.java (98%) rename source/net/yacy/cora/{ranking => sorting}/ClusteredScoreMap.java (96%) rename source/net/yacy/cora/{ranking => sorting}/ConcurrentScoreMap.java (99%) rename source/net/yacy/cora/{ranking => sorting}/OrderedScoreMap.java (99%) rename source/net/yacy/cora/{ranking => sorting}/Rating.java (98%) rename source/net/yacy/cora/{ranking => sorting}/ReversibleScoreMap.java (97%) rename source/net/yacy/cora/{ranking => sorting}/ScoreComparator.java (98%) rename source/net/yacy/cora/{ranking => sorting}/ScoreMap.java (98%) rename source/net/yacy/cora/{ranking => sorting}/WeakPriorityBlockingQueue.java (99%) rename source/net/yacy/{kelondro/blob => cora/storage}/AbstractMapStore.java (73%) create mode 100644 source/net/yacy/cora/storage/MapStore.java delete mode 100644 source/net/yacy/kelondro/blob/MapStore.java delete mode 100644 source/net/yacy/kelondro/order/ByteOrder.java delete mode 100644 source/net/yacy/kelondro/order/CloneableIterator.java delete mode 100644 source/net/yacy/kelondro/order/CloneableMapIterator.java 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 { diff --git a/source/net/yacy/cora/ranking/AbstractScoreMap.java b/source/net/yacy/cora/sorting/AbstractScoreMap.java similarity index 98% rename from source/net/yacy/cora/ranking/AbstractScoreMap.java rename to source/net/yacy/cora/sorting/AbstractScoreMap.java index 9a933d31a..40182d476 100644 --- a/source/net/yacy/cora/ranking/AbstractScoreMap.java +++ b/source/net/yacy/cora/sorting/AbstractScoreMap.java @@ -22,7 +22,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; import java.util.ArrayList; import java.util.List; diff --git a/source/net/yacy/cora/ranking/ClusteredScoreMap.java b/source/net/yacy/cora/sorting/ClusteredScoreMap.java similarity index 96% rename from source/net/yacy/cora/ranking/ClusteredScoreMap.java rename to source/net/yacy/cora/sorting/ClusteredScoreMap.java index 5aac0f1a9..397bd756d 100644 --- a/source/net/yacy/cora/ranking/ClusteredScoreMap.java +++ b/source/net/yacy/cora/sorting/ClusteredScoreMap.java @@ -22,7 +22,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; import java.text.ParseException; import java.text.SimpleDateFormat; diff --git a/source/net/yacy/cora/ranking/ConcurrentScoreMap.java b/source/net/yacy/cora/sorting/ConcurrentScoreMap.java similarity index 99% rename from source/net/yacy/cora/ranking/ConcurrentScoreMap.java rename to source/net/yacy/cora/sorting/ConcurrentScoreMap.java index 102335835..2a0ac3b4c 100644 --- a/source/net/yacy/cora/ranking/ConcurrentScoreMap.java +++ b/source/net/yacy/cora/sorting/ConcurrentScoreMap.java @@ -22,7 +22,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; import java.util.ArrayList; import java.util.HashSet; diff --git a/source/net/yacy/cora/ranking/OrderedScoreMap.java b/source/net/yacy/cora/sorting/OrderedScoreMap.java similarity index 99% rename from source/net/yacy/cora/ranking/OrderedScoreMap.java rename to source/net/yacy/cora/sorting/OrderedScoreMap.java index 2ad3872a9..d0b2e40a3 100644 --- a/source/net/yacy/cora/ranking/OrderedScoreMap.java +++ b/source/net/yacy/cora/sorting/OrderedScoreMap.java @@ -22,7 +22,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; import java.util.ArrayList; import java.util.Comparator; diff --git a/source/net/yacy/cora/ranking/Rating.java b/source/net/yacy/cora/sorting/Rating.java similarity index 98% rename from source/net/yacy/cora/ranking/Rating.java rename to source/net/yacy/cora/sorting/Rating.java index 6b8fc80c7..96f50d33d 100644 --- a/source/net/yacy/cora/ranking/Rating.java +++ b/source/net/yacy/cora/sorting/Rating.java @@ -22,7 +22,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; import java.util.Comparator; diff --git a/source/net/yacy/cora/ranking/ReversibleScoreMap.java b/source/net/yacy/cora/sorting/ReversibleScoreMap.java similarity index 97% rename from source/net/yacy/cora/ranking/ReversibleScoreMap.java rename to source/net/yacy/cora/sorting/ReversibleScoreMap.java index 6b35ea074..09e2fe74a 100644 --- a/source/net/yacy/cora/ranking/ReversibleScoreMap.java +++ b/source/net/yacy/cora/sorting/ReversibleScoreMap.java @@ -22,7 +22,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; public interface ReversibleScoreMap extends ScoreMap { diff --git a/source/net/yacy/cora/ranking/ScoreComparator.java b/source/net/yacy/cora/sorting/ScoreComparator.java similarity index 98% rename from source/net/yacy/cora/ranking/ScoreComparator.java rename to source/net/yacy/cora/sorting/ScoreComparator.java index 41493073c..23919e443 100644 --- a/source/net/yacy/cora/ranking/ScoreComparator.java +++ b/source/net/yacy/cora/sorting/ScoreComparator.java @@ -22,7 +22,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; import java.util.Comparator; diff --git a/source/net/yacy/cora/ranking/ScoreMap.java b/source/net/yacy/cora/sorting/ScoreMap.java similarity index 98% rename from source/net/yacy/cora/ranking/ScoreMap.java rename to source/net/yacy/cora/sorting/ScoreMap.java index 2f53d99dc..66e90bf3b 100644 --- a/source/net/yacy/cora/ranking/ScoreMap.java +++ b/source/net/yacy/cora/sorting/ScoreMap.java @@ -22,7 +22,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; import java.util.Iterator; import java.util.List; diff --git a/source/net/yacy/cora/ranking/WeakPriorityBlockingQueue.java b/source/net/yacy/cora/sorting/WeakPriorityBlockingQueue.java similarity index 99% rename from source/net/yacy/cora/ranking/WeakPriorityBlockingQueue.java rename to source/net/yacy/cora/sorting/WeakPriorityBlockingQueue.java index 9e35a5b36..879e6e5ed 100644 --- a/source/net/yacy/cora/ranking/WeakPriorityBlockingQueue.java +++ b/source/net/yacy/cora/sorting/WeakPriorityBlockingQueue.java @@ -23,7 +23,7 @@ * If not, see . */ -package net.yacy.cora.ranking; +package net.yacy.cora.sorting; import java.util.ArrayList; import java.util.Comparator; diff --git a/source/net/yacy/kelondro/blob/AbstractMapStore.java b/source/net/yacy/cora/storage/AbstractMapStore.java similarity index 73% rename from source/net/yacy/kelondro/blob/AbstractMapStore.java rename to source/net/yacy/cora/storage/AbstractMapStore.java index 073adb742..df030c3e2 100644 --- a/source/net/yacy/kelondro/blob/AbstractMapStore.java +++ b/source/net/yacy/cora/storage/AbstractMapStore.java @@ -1,29 +1,28 @@ -// AbstractMapStore.java -// (C) 2011 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 16.11.2011 on http://yacy.net -// -// $LastChangedDate$ -// $LastChangedRevision$ -// $LastChangedBy$ -// -// LICENSE -// -// 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 +/** + * AbstractMapStore + * 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.kelondro.blob; +package net.yacy.cora.storage; import java.util.AbstractMap; import java.util.Collection; diff --git a/source/net/yacy/cora/storage/MapStore.java b/source/net/yacy/cora/storage/MapStore.java new file mode 100644 index 000000000..8a966fd33 --- /dev/null +++ b/source/net/yacy/cora/storage/MapStore.java @@ -0,0 +1,56 @@ +/** + * MapStore + * 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.storage; + +import java.util.Map; + +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; + +/** + * this is a placeholder interface + * for the complex expressionMap> + * + */ +public interface MapStore extends Map>, Iterable>> { + + /** + * the map should have an ordering on the key elements + * @return a byte order on the key elements + */ + public ByteOrder getOrdering(); + + /** + * the keys of the map should be iterable + * @return an iterator on the map keys + */ + public CloneableIterator keyIterator(); + + /** + * most of the MapMap implementations are file-based, so we should consider a close method + */ + public void close(); +} diff --git a/source/net/yacy/dbtest.java b/source/net/yacy/dbtest.java index ed3fc981f..fe1e92367 100644 --- a/source/net/yacy/dbtest.java +++ b/source/net/yacy/dbtest.java @@ -12,13 +12,13 @@ import java.util.Random; import javax.imageio.ImageIO; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.Index; import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.RowSet; 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.NaturalOrder; import net.yacy.kelondro.table.SQLTable; import net.yacy.kelondro.table.SplitTable; diff --git a/source/net/yacy/document/WordCache.java b/source/net/yacy/document/WordCache.java index ebbeac1c6..f12c0ea1f 100644 --- a/source/net/yacy/document/WordCache.java +++ b/source/net/yacy/document/WordCache.java @@ -36,7 +36,7 @@ import java.util.TreeSet; import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.GZIPInputStream; -import net.yacy.cora.ranking.OrderedScoreMap; +import net.yacy.cora.sorting.OrderedScoreMap; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/document/parser/html/ContentScraper.java b/source/net/yacy/document/parser/html/ContentScraper.java index 595542d81..0a772f27b 100644 --- a/source/net/yacy/document/parser/html/ContentScraper.java +++ b/source/net/yacy/document/parser/html/ContentScraper.java @@ -46,7 +46,7 @@ import java.util.regex.Pattern; import javax.swing.event.EventListenerList; import net.yacy.cora.document.MultiProtocolURI; -import net.yacy.cora.ranking.ClusteredScoreMap; +import net.yacy.cora.sorting.ClusteredScoreMap; import net.yacy.document.SentenceReader; import net.yacy.document.parser.htmlParser; import net.yacy.document.parser.html.Evaluation.Element; diff --git a/source/net/yacy/document/parser/html/Evaluation.java b/source/net/yacy/document/parser/html/Evaluation.java index b2e2a00bd..3c675a4b0 100644 --- a/source/net/yacy/document/parser/html/Evaluation.java +++ b/source/net/yacy/document/parser/html/Evaluation.java @@ -36,7 +36,7 @@ import java.util.Set; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import net.yacy.cora.ranking.ClusteredScoreMap; +import net.yacy.cora.sorting.ClusteredScoreMap; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/blob/ArrayStack.java b/source/net/yacy/kelondro/blob/ArrayStack.java index 3504edbea..e72fec70f 100755 --- a/source/net/yacy/kelondro/blob/ArrayStack.java +++ b/source/net/yacy/kelondro/blob/ArrayStack.java @@ -50,10 +50,10 @@ import java.util.concurrent.TimeUnit; import net.yacy.cora.date.GenericFormatter; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.MergeIterator; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.rwi.Reference; diff --git a/source/net/yacy/kelondro/blob/BEncodedHeap.java b/source/net/yacy/kelondro/blob/BEncodedHeap.java index 72c4f47e6..31e4fa6db 100644 --- a/source/net/yacy/kelondro/blob/BEncodedHeap.java +++ b/source/net/yacy/kelondro/blob/BEncodedHeap.java @@ -38,11 +38,12 @@ import java.util.regex.Pattern; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.storage.MapStore; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.Digest; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.util.BDecoder; diff --git a/source/net/yacy/kelondro/blob/BEncodedHeapBag.java b/source/net/yacy/kelondro/blob/BEncodedHeapBag.java index 41e2b59b9..99f569912 100644 --- a/source/net/yacy/kelondro/blob/BEncodedHeapBag.java +++ b/source/net/yacy/kelondro/blob/BEncodedHeapBag.java @@ -1,27 +1,26 @@ -// BEncodedHeapBag.java -// (C) 2011 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 16.11.2011 on http://yacy.net -// -// $LastChangedDate$ -// $LastChangedRevision$ -// $LastChangedBy$ -// -// LICENSE -// -// 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 - +/** + * BEncodedHeapBag + * 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.kelondro.blob; @@ -37,11 +36,13 @@ import java.util.Map; import net.yacy.cora.date.GenericFormatter; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.storage.AbstractMapStore; +import net.yacy.cora.storage.MapStore; import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.MergeIterator; import net.yacy.kelondro.util.FileUtils; diff --git a/source/net/yacy/kelondro/blob/BEncodedHeapShard.java b/source/net/yacy/kelondro/blob/BEncodedHeapShard.java index 17cf0dcbc..df0961f0a 100644 --- a/source/net/yacy/kelondro/blob/BEncodedHeapShard.java +++ b/source/net/yacy/kelondro/blob/BEncodedHeapShard.java @@ -1,26 +1,26 @@ -// BEncodedHeapShard.java -// (C) 2011 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 16.11.2011 on http://yacy.net -// -// $LastChangedDate$ -// $LastChangedRevision$ -// $LastChangedBy$ -// -// LICENSE -// -// 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 +/** + * BEncodedHeapShard + * 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.kelondro.blob; @@ -33,11 +33,13 @@ import java.util.concurrent.ConcurrentHashMap; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.storage.AbstractMapStore; +import net.yacy.cora.storage.MapStore; import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.MergeIterator; import net.yacy.kelondro.util.FileUtils; @@ -118,14 +120,15 @@ public class BEncodedHeapShard extends AbstractMapStore implements MapStore { filename.endsWith(".heap"); } + @Override public String getShardName(String filename) { return filename.substring(0, this.template.length); } } private ConcurrentHashMap shard; - private File baseDir; - private Method shardMethod; + private final File baseDir; + private final Method shardMethod; public BEncodedHeapShard(File baseDir, Method shardMethod) { this.shard = new ConcurrentHashMap(); diff --git a/source/net/yacy/kelondro/blob/BLOB.java b/source/net/yacy/kelondro/blob/BLOB.java index 28e33a3b3..f068451ca 100644 --- a/source/net/yacy/kelondro/blob/BLOB.java +++ b/source/net/yacy/kelondro/blob/BLOB.java @@ -28,9 +28,9 @@ package net.yacy.kelondro.blob; import java.io.IOException; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.RowSpaceExceededException; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; public interface BLOB { diff --git a/source/net/yacy/kelondro/blob/Compressor.java b/source/net/yacy/kelondro/blob/Compressor.java index 6ccf5193c..96c5bfc49 100644 --- a/source/net/yacy/kelondro/blob/Compressor.java +++ b/source/net/yacy/kelondro/blob/Compressor.java @@ -37,10 +37,10 @@ import java.util.TreeMap; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.util.ByteArray; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/blob/Heap.java b/source/net/yacy/kelondro/blob/Heap.java index 0eb79de12..a1d6630d1 100755 --- a/source/net/yacy/kelondro/blob/Heap.java +++ b/source/net/yacy/kelondro/blob/Heap.java @@ -35,11 +35,11 @@ import java.util.SortedMap; import java.util.TreeMap; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.io.AbstractWriter; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/blob/HeapModifier.java b/source/net/yacy/kelondro/blob/HeapModifier.java index f451e664e..40f3cdd3b 100644 --- a/source/net/yacy/kelondro/blob/HeapModifier.java +++ b/source/net/yacy/kelondro/blob/HeapModifier.java @@ -29,10 +29,10 @@ import java.io.IOException; import java.util.SortedMap; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.io.CachedFileWriter; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; import net.yacy.kelondro.util.FileUtils; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/blob/HeapReader.java b/source/net/yacy/kelondro/blob/HeapReader.java index ce1af19a1..c8e60cac9 100644 --- a/source/net/yacy/kelondro/blob/HeapReader.java +++ b/source/net/yacy/kelondro/blob/HeapReader.java @@ -37,13 +37,13 @@ import java.util.concurrent.ExecutionException; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.HandleMap; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.io.CachedFileWriter; import net.yacy.kelondro.io.Writer; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.Digest; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.order.RotateIterator; diff --git a/source/net/yacy/kelondro/blob/HeapWriter.java b/source/net/yacy/kelondro/blob/HeapWriter.java index de1e0dbdd..185302d6b 100644 --- a/source/net/yacy/kelondro/blob/HeapWriter.java +++ b/source/net/yacy/kelondro/blob/HeapWriter.java @@ -31,10 +31,10 @@ import java.io.FileOutputStream; import java.io.IOException; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; import net.yacy.kelondro.index.HandleMap; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; import net.yacy.kelondro.util.FileUtils; diff --git a/source/net/yacy/kelondro/blob/MapDataMining.java b/source/net/yacy/kelondro/blob/MapDataMining.java index 75b92dbd1..1fc87c0ef 100644 --- a/source/net/yacy/kelondro/blob/MapDataMining.java +++ b/source/net/yacy/kelondro/blob/MapDataMining.java @@ -35,15 +35,15 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import net.yacy.cora.document.UTF8; -import net.yacy.cora.ranking.ClusteredScoreMap; -import net.yacy.cora.ranking.ConcurrentScoreMap; -import net.yacy.cora.ranking.ScoreMap; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.sorting.ClusteredScoreMap; +import net.yacy.cora.sorting.ConcurrentScoreMap; +import net.yacy.cora.sorting.ScoreMap; import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; public class MapDataMining extends MapHeap { diff --git a/source/net/yacy/kelondro/blob/MapHeap.java b/source/net/yacy/kelondro/blob/MapHeap.java index 1d1611244..42073f9c7 100644 --- a/source/net/yacy/kelondro/blob/MapHeap.java +++ b/source/net/yacy/kelondro/blob/MapHeap.java @@ -43,12 +43,12 @@ import java.util.concurrent.ConcurrentHashMap; import net.yacy.cora.date.GenericFormatter; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.cora.storage.ARC; import net.yacy.cora.storage.ConcurrentARC; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.order.RotateIterator; import net.yacy.kelondro.util.FileUtils; diff --git a/source/net/yacy/kelondro/blob/MapStore.java b/source/net/yacy/kelondro/blob/MapStore.java deleted file mode 100644 index e3c3f47b9..000000000 --- a/source/net/yacy/kelondro/blob/MapStore.java +++ /dev/null @@ -1,56 +0,0 @@ -// MapMap.java -// (C) 2011 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 16.11.2011 on http://yacy.net -// -// $LastChangedDate$ -// $LastChangedRevision$ -// $LastChangedBy$ -// -// LICENSE -// -// 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.kelondro.blob; - -import java.util.Map; - -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; - -/** - * this is a placeholder interface - * for the complex expressionMap> - * - */ -public interface MapStore extends Map>, Iterable>> { - - /** - * the map should have an ordering on the key elements - * @return a byte order on the key elements - */ - public ByteOrder getOrdering(); - - /** - * the keys of the map should be iterable - * @return an iterator on the map keys - */ - public CloneableIterator keyIterator(); - - /** - * most of the MapMap implementations are file-based, so we should consider a close method - */ - public void close(); -} diff --git a/source/net/yacy/kelondro/index/BinSearch.java b/source/net/yacy/kelondro/index/BinSearch.java index fcebedce8..9e99c7e67 100644 --- a/source/net/yacy/kelondro/index/BinSearch.java +++ b/source/net/yacy/kelondro/index/BinSearch.java @@ -32,7 +32,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.List; -import net.yacy.kelondro.order.ByteOrder; +import net.yacy.cora.order.ByteOrder; import net.yacy.kelondro.order.NaturalOrder; diff --git a/source/net/yacy/kelondro/index/BufferedObjectIndex.java b/source/net/yacy/kelondro/index/BufferedObjectIndex.java index d11620452..cb293d556 100644 --- a/source/net/yacy/kelondro/index/BufferedObjectIndex.java +++ b/source/net/yacy/kelondro/index/BufferedObjectIndex.java @@ -32,9 +32,9 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.Row.Entry; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.MergeIterator; /** diff --git a/source/net/yacy/kelondro/index/Cache.java b/source/net/yacy/kelondro/index/Cache.java index 120aca368..17e275efb 100644 --- a/source/net/yacy/kelondro/index/Cache.java +++ b/source/net/yacy/kelondro/index/Cache.java @@ -33,8 +33,8 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.Row.Entry; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/index/HandleMap.java b/source/net/yacy/kelondro/index/HandleMap.java index 21d3d2f22..8d4dd0863 100644 --- a/source/net/yacy/kelondro/index/HandleMap.java +++ b/source/net/yacy/kelondro/index/HandleMap.java @@ -45,9 +45,9 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; public final class HandleMap implements Iterable { diff --git a/source/net/yacy/kelondro/index/HandleSet.java b/source/net/yacy/kelondro/index/HandleSet.java index ce11fbc6d..a1ecbd8a2 100644 --- a/source/net/yacy/kelondro/index/HandleSet.java +++ b/source/net/yacy/kelondro/index/HandleSet.java @@ -34,9 +34,9 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.Iterator; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.util.SetTools; diff --git a/source/net/yacy/kelondro/index/Index.java b/source/net/yacy/kelondro/index/Index.java index da436c848..9e90366ce 100644 --- a/source/net/yacy/kelondro/index/Index.java +++ b/source/net/yacy/kelondro/index/Index.java @@ -30,7 +30,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import net.yacy.kelondro.order.CloneableIterator; +import net.yacy.cora.order.CloneableIterator; public interface Index extends Iterable { diff --git a/source/net/yacy/kelondro/index/RAMIndex.java b/source/net/yacy/kelondro/index/RAMIndex.java index 878176d91..30a9de1e0 100644 --- a/source/net/yacy/kelondro/index/RAMIndex.java +++ b/source/net/yacy/kelondro/index/RAMIndex.java @@ -32,8 +32,8 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.Row.Entry; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.MergeIterator; import net.yacy.kelondro.order.StackIterator; diff --git a/source/net/yacy/kelondro/index/RAMIndexCluster.java b/source/net/yacy/kelondro/index/RAMIndexCluster.java index d8b118424..ea5d01eea 100644 --- a/source/net/yacy/kelondro/index/RAMIndexCluster.java +++ b/source/net/yacy/kelondro/index/RAMIndexCluster.java @@ -32,9 +32,9 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.Row.Entry; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.MergeIterator; import net.yacy.kelondro.order.StackIterator; diff --git a/source/net/yacy/kelondro/index/Row.java b/source/net/yacy/kelondro/index/Row.java index b292fa6ef..55b559aa5 100644 --- a/source/net/yacy/kelondro/index/Row.java +++ b/source/net/yacy/kelondro/index/Row.java @@ -37,12 +37,12 @@ import java.util.concurrent.ConcurrentHashMap; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; -import net.yacy.cora.ranking.AbstractOrder; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.AbstractOrder; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.Order; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; import net.yacy.kelondro.order.Bitfield; -import net.yacy.kelondro.order.ByteOrder; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.util.ByteBuffer; import net.yacy.kelondro.util.kelondroException; diff --git a/source/net/yacy/kelondro/index/RowCollection.java b/source/net/yacy/kelondro/index/RowCollection.java index 0d8df7609..df9480281 100644 --- a/source/net/yacy/kelondro/index/RowCollection.java +++ b/source/net/yacy/kelondro/index/RowCollection.java @@ -34,12 +34,12 @@ import java.util.concurrent.Callable; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; import net.yacy.cora.sorting.Array; import net.yacy.cora.sorting.Sortable; import net.yacy.kelondro.index.Row.Entry; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; -import net.yacy.kelondro.order.ByteOrder; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.util.FileUtils; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/index/RowSet.java b/source/net/yacy/kelondro/index/RowSet.java index e69f8410a..2ba38a0d6 100644 --- a/source/net/yacy/kelondro/index/RowSet.java +++ b/source/net/yacy/kelondro/index/RowSet.java @@ -35,9 +35,9 @@ import java.util.TreeMap; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/order/Base64Order.java b/source/net/yacy/kelondro/order/Base64Order.java index d264be900..2b2f689e7 100644 --- a/source/net/yacy/kelondro/order/Base64Order.java +++ b/source/net/yacy/kelondro/order/Base64Order.java @@ -30,8 +30,9 @@ package net.yacy.kelondro.order; import java.util.Comparator; import net.yacy.cora.document.UTF8; -import net.yacy.cora.ranking.AbstractOrder; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.AbstractOrder; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.Order; public class Base64Order extends AbstractOrder implements ByteOrder, Comparator, Cloneable { diff --git a/source/net/yacy/kelondro/order/ByteOrder.java b/source/net/yacy/kelondro/order/ByteOrder.java deleted file mode 100644 index 630aab691..000000000 --- a/source/net/yacy/kelondro/order/ByteOrder.java +++ /dev/null @@ -1,54 +0,0 @@ -// ByteOrder.java -// ----------------------------- -// (C) 2008 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 10.01.2008 on http://yacy.net -// -// This is a part of YaCy, a peer-to-peer based web search engine -// -// $LastChangedDate$ -// $LastChangedRevision$ -// $LastChangedBy$ -// -// LICENSE -// -// 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.kelondro.order; - -import net.yacy.cora.ranking.Order; - - -public interface ByteOrder extends Order { - - public boolean wellformed(byte[] a); - - public boolean wellformed(byte[] a, int start, int len); - - 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); - - 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/kelondro/order/CloneableIterator.java b/source/net/yacy/kelondro/order/CloneableIterator.java deleted file mode 100644 index e51a86ad2..000000000 --- a/source/net/yacy/kelondro/order/CloneableIterator.java +++ /dev/null @@ -1,37 +0,0 @@ -// CloneableIterator.java -// (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 08.03.2007 on http://www.anomic.de -// -// This is a part of YaCy, a peer-to-peer based web search engine -// -// $LastChangedDate$ -// $LastChangedRevision$ -// $LastChangedBy$ -// -// LICENSE -// -// 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.kelondro.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/kelondro/order/CloneableMapIterator.java b/source/net/yacy/kelondro/order/CloneableMapIterator.java deleted file mode 100644 index ce8cc0707..000000000 --- a/source/net/yacy/kelondro/order/CloneableMapIterator.java +++ /dev/null @@ -1,82 +0,0 @@ -// CloneableMapIterator.java -// (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 25.04.2007 on http://yacy.net -// -// This is a part of YaCy, a peer-to-peer based web search engine -// -// $LastChangedDate$ -// $LastChangedRevision$ -// $LastChangedBy$ -// -// LICENSE -// -// 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.kelondro.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 (iter.hasNext()) this.next = iter.next(); else this.next = null; - } else while (iter.hasNext()) { - this.next = iter.next(); - if (map.comparator().compare(next, start) > 1) break; - } - this.last = null; - } - - @SuppressWarnings("unchecked") - public CloneableMapIterator clone(final Object modifier) { - return new CloneableMapIterator(map, (E) modifier); - } - - public boolean hasNext() { - return this.next != null; - } - - 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; - } - - public void remove() { - this.map.remove(this.last); - } - -} diff --git a/source/net/yacy/kelondro/order/MergeIterator.java b/source/net/yacy/kelondro/order/MergeIterator.java index 95aa695cf..2500f0875 100644 --- a/source/net/yacy/kelondro/order/MergeIterator.java +++ b/source/net/yacy/kelondro/order/MergeIterator.java @@ -29,7 +29,8 @@ import java.util.Comparator; import java.util.ConcurrentModificationException; import java.util.Iterator; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.order.Order; import net.yacy.kelondro.logging.Log; diff --git a/source/net/yacy/kelondro/order/NaturalOrder.java b/source/net/yacy/kelondro/order/NaturalOrder.java index 7247eb629..d01a5f25d 100644 --- a/source/net/yacy/kelondro/order/NaturalOrder.java +++ b/source/net/yacy/kelondro/order/NaturalOrder.java @@ -29,8 +29,9 @@ package net.yacy.kelondro.order; import java.util.Comparator; import java.util.Iterator; -import net.yacy.cora.ranking.AbstractOrder; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.AbstractOrder; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.Order; import net.yacy.kelondro.index.HandleSet; public final class NaturalOrder extends AbstractOrder implements ByteOrder, Comparator, Cloneable { diff --git a/source/net/yacy/kelondro/order/RotateIterator.java b/source/net/yacy/kelondro/order/RotateIterator.java index c16365e9f..6d9365e08 100644 --- a/source/net/yacy/kelondro/order/RotateIterator.java +++ b/source/net/yacy/kelondro/order/RotateIterator.java @@ -26,6 +26,8 @@ package net.yacy.kelondro.order; +import net.yacy.cora.order.CloneableIterator; + public class RotateIterator implements CloneableIterator { diff --git a/source/net/yacy/kelondro/order/StackIterator.java b/source/net/yacy/kelondro/order/StackIterator.java index 260cfa652..d9cf0a902 100644 --- a/source/net/yacy/kelondro/order/StackIterator.java +++ b/source/net/yacy/kelondro/order/StackIterator.java @@ -24,6 +24,8 @@ package net.yacy.kelondro.order; import java.util.ConcurrentModificationException; +import net.yacy.cora.order.CloneableIterator; + public class StackIterator implements CloneableIterator { diff --git a/source/net/yacy/kelondro/order/StringOrder.java b/source/net/yacy/kelondro/order/StringOrder.java index a92561de4..9b83ada58 100644 --- a/source/net/yacy/kelondro/order/StringOrder.java +++ b/source/net/yacy/kelondro/order/StringOrder.java @@ -30,7 +30,8 @@ package net.yacy.kelondro.order; import java.util.Comparator; import net.yacy.cora.document.UTF8; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.Order; public class StringOrder implements Comparator { diff --git a/source/net/yacy/kelondro/rwi/AbstractBufferedIndex.java b/source/net/yacy/kelondro/rwi/AbstractBufferedIndex.java index 569180dfc..926d6d2ab 100644 --- a/source/net/yacy/kelondro/rwi/AbstractBufferedIndex.java +++ b/source/net/yacy/kelondro/rwi/AbstractBufferedIndex.java @@ -31,7 +31,7 @@ import java.io.IOException; import java.util.Iterator; import java.util.TreeSet; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.Order; public abstract class AbstractBufferedIndex extends AbstractIndex implements BufferedIndex { diff --git a/source/net/yacy/kelondro/rwi/AbstractIndex.java b/source/net/yacy/kelondro/rwi/AbstractIndex.java index e357d54ed..8418eab51 100644 --- a/source/net/yacy/kelondro/rwi/AbstractIndex.java +++ b/source/net/yacy/kelondro/rwi/AbstractIndex.java @@ -32,7 +32,7 @@ import java.util.Iterator; import java.util.TreeMap; import java.util.TreeSet; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.Order; import net.yacy.kelondro.index.HandleSet; import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.RowSpaceExceededException; diff --git a/source/net/yacy/kelondro/rwi/BufferedIndex.java b/source/net/yacy/kelondro/rwi/BufferedIndex.java index 23959a994..9509cfe75 100644 --- a/source/net/yacy/kelondro/rwi/BufferedIndex.java +++ b/source/net/yacy/kelondro/rwi/BufferedIndex.java @@ -30,7 +30,7 @@ package net.yacy.kelondro.rwi; import java.io.IOException; import java.util.TreeSet; -import net.yacy.kelondro.order.CloneableIterator; +import net.yacy.cora.order.CloneableIterator; /* diff --git a/source/net/yacy/kelondro/rwi/Index.java b/source/net/yacy/kelondro/rwi/Index.java index bf33dcf27..edc4e7d64 100644 --- a/source/net/yacy/kelondro/rwi/Index.java +++ b/source/net/yacy/kelondro/rwi/Index.java @@ -32,12 +32,12 @@ import java.io.IOException; import java.util.TreeMap; import java.util.TreeSet; -import net.yacy.cora.ranking.Rating; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.sorting.Rating; import net.yacy.kelondro.index.HandleSet; import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.RowSpaceExceededException; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; public interface Index extends Iterable> { diff --git a/source/net/yacy/kelondro/rwi/IndexCell.java b/source/net/yacy/kelondro/rwi/IndexCell.java index 7125ebdeb..c5a0c87e2 100644 --- a/source/net/yacy/kelondro/rwi/IndexCell.java +++ b/source/net/yacy/kelondro/rwi/IndexCell.java @@ -32,15 +32,15 @@ import java.util.Iterator; import java.util.Map; import java.util.TreeMap; -import net.yacy.cora.ranking.Order; -import net.yacy.cora.ranking.Rating; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.order.Order; +import net.yacy.cora.sorting.Rating; import net.yacy.cora.storage.ComparableARC; import net.yacy.kelondro.data.meta.URIMetadataRow; import net.yacy.kelondro.index.HandleSet; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.MergeIterator; import net.yacy.kelondro.util.EventTracker; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/rwi/IndexReader.java b/source/net/yacy/kelondro/rwi/IndexReader.java index 2857c3bd1..c1051e6fc 100644 --- a/source/net/yacy/kelondro/rwi/IndexReader.java +++ b/source/net/yacy/kelondro/rwi/IndexReader.java @@ -26,8 +26,8 @@ package net.yacy.kelondro.rwi; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.HandleSet; -import net.yacy.kelondro.order.CloneableIterator; public interface IndexReader { diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainer.java b/source/net/yacy/kelondro/rwi/ReferenceContainer.java index 1af1fd270..f799abb8f 100644 --- a/source/net/yacy/kelondro/rwi/ReferenceContainer.java +++ b/source/net/yacy/kelondro/rwi/ReferenceContainer.java @@ -36,13 +36,13 @@ import java.util.List; import java.util.TreeMap; import net.yacy.cora.document.ASCII; +import net.yacy.cora.order.ByteOrder; import net.yacy.kelondro.index.HandleSet; import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.RowSet; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; -import net.yacy.kelondro.order.ByteOrder; /** diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java b/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java index 96e111f05..ce3f77a6e 100644 --- a/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java +++ b/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java @@ -29,7 +29,9 @@ import java.io.IOException; import java.util.Date; import java.util.Iterator; -import net.yacy.cora.ranking.Rating; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.sorting.Rating; import net.yacy.kelondro.blob.ArrayStack; import net.yacy.kelondro.blob.BLOB; import net.yacy.kelondro.data.word.Word; @@ -38,8 +40,6 @@ import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.RowSet; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; public final class ReferenceContainerArray { diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java b/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java index 53063e792..5c2583520 100644 --- a/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java +++ b/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java @@ -36,15 +36,15 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import net.yacy.cora.ranking.Rating; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.sorting.Rating; import net.yacy.kelondro.blob.HeapWriter; import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.index.HandleSet; import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.util.ByteArray; import net.yacy.kelondro.util.FileUtils; diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainerOrder.java b/source/net/yacy/kelondro/rwi/ReferenceContainerOrder.java index 22be80d09..a629ad0f1 100644 --- a/source/net/yacy/kelondro/rwi/ReferenceContainerOrder.java +++ b/source/net/yacy/kelondro/rwi/ReferenceContainerOrder.java @@ -26,8 +26,8 @@ package net.yacy.kelondro.rwi; -import net.yacy.cora.ranking.AbstractOrder; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.AbstractOrder; +import net.yacy.cora.order.Order; public class ReferenceContainerOrder extends AbstractOrder> implements Order>, Cloneable { diff --git a/source/net/yacy/kelondro/rwi/ReferenceIterator.java b/source/net/yacy/kelondro/rwi/ReferenceIterator.java index cfe58f130..764e2d362 100644 --- a/source/net/yacy/kelondro/rwi/ReferenceIterator.java +++ b/source/net/yacy/kelondro/rwi/ReferenceIterator.java @@ -30,11 +30,11 @@ import java.io.File; import java.io.IOException; import java.util.Map; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.blob.HeapReader; import net.yacy.kelondro.index.RowSet; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.util.LookAheadIterator; /** diff --git a/source/net/yacy/kelondro/table/SQLTable.java b/source/net/yacy/kelondro/table/SQLTable.java index a6044392c..9ee56e70e 100644 --- a/source/net/yacy/kelondro/table/SQLTable.java +++ b/source/net/yacy/kelondro/table/SQLTable.java @@ -42,13 +42,13 @@ import java.util.TreeMap; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.Index; import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.Row.Entry; import net.yacy.kelondro.index.RowCollection; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.ByteOrder; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.NaturalOrder; diff --git a/source/net/yacy/kelondro/table/SplitTable.java b/source/net/yacy/kelondro/table/SplitTable.java index 9e20fb80e..465ed92e4 100644 --- a/source/net/yacy/kelondro/table/SplitTable.java +++ b/source/net/yacy/kelondro/table/SplitTable.java @@ -40,7 +40,8 @@ import java.util.Random; import java.util.TreeMap; import net.yacy.cora.date.GenericFormatter; -import net.yacy.cora.ranking.Order; +import net.yacy.cora.order.CloneableIterator; +import net.yacy.cora.order.Order; import net.yacy.kelondro.blob.ArrayStack; import net.yacy.kelondro.index.Cache; import net.yacy.kelondro.index.HandleSet; @@ -50,7 +51,6 @@ import net.yacy.kelondro.index.Row.Entry; import net.yacy.kelondro.index.RowCollection; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.MergeIterator; import net.yacy.kelondro.order.StackIterator; import net.yacy.kelondro.util.FileUtils; diff --git a/source/net/yacy/kelondro/table/Table.java b/source/net/yacy/kelondro/table/Table.java index b7a4f565d..4bbe283fc 100644 --- a/source/net/yacy/kelondro/table/Table.java +++ b/source/net/yacy/kelondro/table/Table.java @@ -39,6 +39,7 @@ import java.util.Map; import java.util.TreeMap; import java.util.TreeSet; +import net.yacy.cora.order.CloneableIterator; import net.yacy.kelondro.index.Column; import net.yacy.kelondro.index.HandleMap; import net.yacy.kelondro.index.Index; @@ -50,7 +51,6 @@ import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.io.BufferedRecords; import net.yacy.kelondro.io.Records; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.order.NaturalOrder; import net.yacy.kelondro.util.FileUtils; import net.yacy.kelondro.util.MemoryControl; diff --git a/source/net/yacy/kelondro/util/ByteArray.java b/source/net/yacy/kelondro/util/ByteArray.java index 795bb8182..eb4810818 100644 --- a/source/net/yacy/kelondro/util/ByteArray.java +++ b/source/net/yacy/kelondro/util/ByteArray.java @@ -27,7 +27,7 @@ package net.yacy.kelondro.util; import java.util.HashMap; import net.yacy.cora.document.UTF8; -import net.yacy.kelondro.order.ByteOrder; +import net.yacy.cora.order.ByteOrder; /** diff --git a/source/net/yacy/peers/Seed.java b/source/net/yacy/peers/Seed.java index 87c3c684f..a8c31a62e 100644 --- a/source/net/yacy/peers/Seed.java +++ b/source/net/yacy/peers/Seed.java @@ -63,8 +63,8 @@ import net.yacy.cora.date.GenericFormatter; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; import net.yacy.cora.protocol.Domains; -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.word.Word; import net.yacy.kelondro.index.HandleSet; import net.yacy.kelondro.order.Base64Order; diff --git a/source/net/yacy/peers/dht/PeerSelection.java b/source/net/yacy/peers/dht/PeerSelection.java index 95e1f3913..1ea0d9e96 100755 --- a/source/net/yacy/peers/dht/PeerSelection.java +++ b/source/net/yacy/peers/dht/PeerSelection.java @@ -35,8 +35,8 @@ import java.util.SortedMap; import net.yacy.cora.date.AbstractFormatter; import net.yacy.cora.document.ASCII; -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.word.Word; import net.yacy.kelondro.index.HandleSet; import net.yacy.kelondro.index.RowSpaceExceededException; diff --git a/source/net/yacy/search/index/MetadataRepository.java b/source/net/yacy/search/index/MetadataRepository.java index 6aedb4197..345569d6b 100644 --- a/source/net/yacy/search/index/MetadataRepository.java +++ b/source/net/yacy/search/index/MetadataRepository.java @@ -41,11 +41,12 @@ import java.util.TreeSet; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.MultiProtocolURI; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.CloneableIterator; import net.yacy.cora.protocol.http.HTTPClient; -import net.yacy.cora.ranking.ConcurrentScoreMap; -import net.yacy.cora.ranking.ScoreMap; -import net.yacy.cora.ranking.WeakPriorityBlockingQueue; import net.yacy.cora.services.federated.solr.SolrConnector; +import net.yacy.cora.sorting.ConcurrentScoreMap; +import net.yacy.cora.sorting.ScoreMap; +import net.yacy.cora.sorting.WeakPriorityBlockingQueue; import net.yacy.document.parser.html.CharacterCoding; import net.yacy.kelondro.data.meta.DigestURI; import net.yacy.kelondro.data.meta.URIMetadataRow; @@ -56,7 +57,6 @@ import net.yacy.kelondro.index.Index; import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; -import net.yacy.kelondro.order.CloneableIterator; import net.yacy.kelondro.table.SplitTable; import net.yacy.kelondro.util.MemoryControl; import net.yacy.repository.Blacklist; diff --git a/source/net/yacy/search/index/Segment.java b/source/net/yacy/search/index/Segment.java index 3742d0203..0779736b9 100644 --- a/source/net/yacy/search/index/Segment.java +++ b/source/net/yacy/search/index/Segment.java @@ -37,6 +37,7 @@ import java.util.TreeSet; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.MultiProtocolURI; import net.yacy.cora.document.UTF8; +import net.yacy.cora.order.ByteOrder; import net.yacy.cora.services.federated.solr.SolrConnector; import net.yacy.cora.services.federated.yacy.CacheStrategy; import net.yacy.document.Condenser; @@ -55,7 +56,6 @@ import net.yacy.kelondro.index.HandleSet; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.order.Base64Order; -import net.yacy.kelondro.order.ByteOrder; import net.yacy.kelondro.rwi.IndexCell; import net.yacy.kelondro.rwi.ReferenceContainer; import net.yacy.kelondro.rwi.ReferenceFactory; diff --git a/source/net/yacy/search/query/RWIProcess.java b/source/net/yacy/search/query/RWIProcess.java index 06a6d856b..a4374a734 100644 --- a/source/net/yacy/search/query/RWIProcess.java +++ b/source/net/yacy/search/query/RWIProcess.java @@ -41,11 +41,11 @@ import java.util.regex.Pattern; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.MultiProtocolURI; import net.yacy.cora.protocol.Scanner; -import net.yacy.cora.ranking.ClusteredScoreMap; -import net.yacy.cora.ranking.ConcurrentScoreMap; -import net.yacy.cora.ranking.ScoreMap; -import net.yacy.cora.ranking.WeakPriorityBlockingQueue; -import net.yacy.cora.ranking.WeakPriorityBlockingQueue.ReverseElement; +import net.yacy.cora.sorting.ClusteredScoreMap; +import net.yacy.cora.sorting.ConcurrentScoreMap; +import net.yacy.cora.sorting.ScoreMap; +import net.yacy.cora.sorting.WeakPriorityBlockingQueue; +import net.yacy.cora.sorting.WeakPriorityBlockingQueue.ReverseElement; import net.yacy.document.Condenser; import net.yacy.kelondro.data.meta.DigestURI; import net.yacy.kelondro.data.meta.URIMetadataRow; diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.java index b94d5fe3d..b19a59e78 100644 --- a/source/net/yacy/search/query/SearchEvent.java +++ b/source/net/yacy/search/query/SearchEvent.java @@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; -import net.yacy.cora.ranking.ScoreMap; +import net.yacy.cora.sorting.ScoreMap; import net.yacy.document.LargeNumberCache; import net.yacy.kelondro.data.word.WordReference; import net.yacy.kelondro.data.word.WordReferenceFactory; diff --git a/source/net/yacy/search/query/SnippetProcess.java b/source/net/yacy/search/query/SnippetProcess.java index b2eb85473..f665d85c2 100644 --- a/source/net/yacy/search/query/SnippetProcess.java +++ b/source/net/yacy/search/query/SnippetProcess.java @@ -34,12 +34,12 @@ import java.util.regex.Pattern; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.MultiProtocolURI; import net.yacy.cora.protocol.ResponseHeader; -import net.yacy.cora.ranking.ScoreMap; -import net.yacy.cora.ranking.WeakPriorityBlockingQueue; -import net.yacy.cora.ranking.WeakPriorityBlockingQueue.Element; -import net.yacy.cora.ranking.WeakPriorityBlockingQueue.ReverseElement; import net.yacy.cora.services.federated.solr.SolrConnector; import net.yacy.cora.services.federated.yacy.CacheStrategy; +import net.yacy.cora.sorting.ScoreMap; +import net.yacy.cora.sorting.WeakPriorityBlockingQueue; +import net.yacy.cora.sorting.WeakPriorityBlockingQueue.Element; +import net.yacy.cora.sorting.WeakPriorityBlockingQueue.ReverseElement; import net.yacy.document.Condenser; import net.yacy.kelondro.data.meta.URIMetadataRow; import net.yacy.kelondro.data.word.Word; diff --git a/source/net/yacy/search/ranking/BlockRank.java b/source/net/yacy/search/ranking/BlockRank.java index 8fce37eb5..24b146e22 100644 --- a/source/net/yacy/search/ranking/BlockRank.java +++ b/source/net/yacy/search/ranking/BlockRank.java @@ -33,8 +33,8 @@ import java.util.List; import java.util.Map; import net.yacy.cora.document.ASCII; -import net.yacy.cora.ranking.OrderedScoreMap; -import net.yacy.cora.ranking.ScoreMap; +import net.yacy.cora.sorting.OrderedScoreMap; +import net.yacy.cora.sorting.ScoreMap; import net.yacy.kelondro.index.BinSearch; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; diff --git a/source/net/yacy/search/ranking/ReferenceOrder.java b/source/net/yacy/search/ranking/ReferenceOrder.java index ceea48447..0fade437b 100644 --- a/source/net/yacy/search/ranking/ReferenceOrder.java +++ b/source/net/yacy/search/ranking/ReferenceOrder.java @@ -33,7 +33,7 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.Semaphore; -import net.yacy.cora.ranking.ConcurrentScoreMap; +import net.yacy.cora.sorting.ConcurrentScoreMap; import net.yacy.document.Condenser; import net.yacy.document.LargeNumberCache; import net.yacy.kelondro.data.meta.DigestURI; diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.java index 90fef8654..b6af8112e 100644 --- a/source/net/yacy/yacy.java +++ b/source/net/yacy/yacy.java @@ -51,9 +51,9 @@ import net.yacy.cora.document.UTF8; import net.yacy.cora.protocol.ClientIdentification; import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.http.HTTPClient; -import net.yacy.cora.ranking.OrderedScoreMap; -import net.yacy.cora.ranking.ScoreMap; import net.yacy.cora.sorting.Array; +import net.yacy.cora.sorting.OrderedScoreMap; +import net.yacy.cora.sorting.ScoreMap; import net.yacy.gui.Tray; import net.yacy.gui.YaCyApp; import net.yacy.gui.framework.Browser;