From 75df87832cb097bc0b7f8380db3578cb5e476f64 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 24 Aug 2011 23:08:28 +0000 Subject: [PATCH] refactoring/better naming of methods and classes git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7895 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/net/yacy/kelondro/rwi/IndexCell.java | 4 ++-- .../kelondro/rwi/ReferenceContainerArray.java | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/source/net/yacy/kelondro/rwi/IndexCell.java b/source/net/yacy/kelondro/rwi/IndexCell.java index b763b19c3..349133d5d 100644 --- a/source/net/yacy/kelondro/rwi/IndexCell.java +++ b/source/net/yacy/kelondro/rwi/IndexCell.java @@ -457,7 +457,7 @@ public final class IndexCell extends AbstractBu this.ram.references(starttermHash, rot), new MergeIterator>( this.ram.references(starttermHash, false), - this.array.wordContainerIterator(starttermHash, false), + this.array.referenceContainerIterator(starttermHash, false), containerOrder, ReferenceContainer.containerMergeMethod, true), @@ -474,7 +474,7 @@ public final class IndexCell extends AbstractBu } return new MergeIterator>( this.ram.references(startTermHash, false), - this.array.wordContainerIterator(startTermHash, false), + this.array.referenceContainerIterator(startTermHash, false), containerOrder, ReferenceContainer.containerMergeMethod, true); diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java b/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java index 13f8c12c0..9f12e5112 100644 --- a/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java +++ b/source/net/yacy/kelondro/rwi/ReferenceContainerArray.java @@ -113,20 +113,16 @@ public final class ReferenceContainerArray { * objects in the cache. * @throws IOException */ - public CloneableIterator> wordContainerIterator(final byte[] startWordHash, final boolean rot) { + public CloneableIterator> referenceContainerIterator(final byte[] startWordHash, final boolean rot) { try { - return new heapCacheIterator(startWordHash, rot); + return new ReferenceContainerIterator(startWordHash, rot); } catch (IOException e) { Log.logException(e); return null; } } - /** - * cache iterator: iterates objects within the heap cache. This can only be used - * for write-enabled heaps, read-only heaps do not have a heap cache - */ - public class heapCacheIterator implements CloneableIterator>, Iterable> { + public class ReferenceContainerIterator implements CloneableIterator>, Iterable> { // this class exists, because the wCache cannot be iterated with rotation // and because every indexContainer Object that is iterated must be returned as top-level-clone @@ -136,15 +132,15 @@ public final class ReferenceContainerArray { private final boolean rot; protected CloneableIterator iterator; - public heapCacheIterator(final byte[] startWordHash, final boolean rot) throws IOException { + public ReferenceContainerIterator(final byte[] startWordHash, final boolean rot) throws IOException { this.rot = rot; this.iterator = array.keys(true, startWordHash); // The collection's iterator will return the values in the order that their corresponding keys appear in the tree. } - public heapCacheIterator clone(final Object secondWordHash) { + public ReferenceContainerIterator clone(final Object secondWordHash) { try { - return new heapCacheIterator((byte[]) secondWordHash, rot); + return new ReferenceContainerIterator((byte[]) secondWordHash, rot); } catch (IOException e) { Log.logException(e); return null;