refactoring/better naming of methods and classes

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7895 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2011-08-24 23:08:28 +00:00
parent 9f9f634de2
commit 75df87832c
2 changed files with 8 additions and 12 deletions

View File

@ -457,7 +457,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
this.ram.references(starttermHash, rot), this.ram.references(starttermHash, rot),
new MergeIterator<ReferenceContainer<ReferenceType>>( new MergeIterator<ReferenceContainer<ReferenceType>>(
this.ram.references(starttermHash, false), this.ram.references(starttermHash, false),
this.array.wordContainerIterator(starttermHash, false), this.array.referenceContainerIterator(starttermHash, false),
containerOrder, containerOrder,
ReferenceContainer.containerMergeMethod, ReferenceContainer.containerMergeMethod,
true), true),
@ -474,7 +474,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
} }
return new MergeIterator<ReferenceContainer<ReferenceType>>( return new MergeIterator<ReferenceContainer<ReferenceType>>(
this.ram.references(startTermHash, false), this.ram.references(startTermHash, false),
this.array.wordContainerIterator(startTermHash, false), this.array.referenceContainerIterator(startTermHash, false),
containerOrder, containerOrder,
ReferenceContainer.containerMergeMethod, ReferenceContainer.containerMergeMethod,
true); true);

View File

@ -113,20 +113,16 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
* objects in the cache. * objects in the cache.
* @throws IOException * @throws IOException
*/ */
public CloneableIterator<ReferenceContainer<ReferenceType>> wordContainerIterator(final byte[] startWordHash, final boolean rot) { public CloneableIterator<ReferenceContainer<ReferenceType>> referenceContainerIterator(final byte[] startWordHash, final boolean rot) {
try { try {
return new heapCacheIterator(startWordHash, rot); return new ReferenceContainerIterator(startWordHash, rot);
} catch (IOException e) { } catch (IOException e) {
Log.logException(e); Log.logException(e);
return null; return null;
} }
} }
/** public class ReferenceContainerIterator implements CloneableIterator<ReferenceContainer<ReferenceType>>, Iterable<ReferenceContainer<ReferenceType>> {
* 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<ReferenceContainer<ReferenceType>>, Iterable<ReferenceContainer<ReferenceType>> {
// this class exists, because the wCache cannot be iterated with rotation // 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 // and because every indexContainer Object that is iterated must be returned as top-level-clone
@ -136,15 +132,15 @@ public final class ReferenceContainerArray<ReferenceType extends Reference> {
private final boolean rot; private final boolean rot;
protected CloneableIterator<byte[]> iterator; protected CloneableIterator<byte[]> 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.rot = rot;
this.iterator = array.keys(true, startWordHash); 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. // 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 { try {
return new heapCacheIterator((byte[]) secondWordHash, rot); return new ReferenceContainerIterator((byte[]) secondWordHash, rot);
} catch (IOException e) { } catch (IOException e) {
Log.logException(e); Log.logException(e);
return null; return null;