From b30645305bb614488f273591da45b139d6ed78ff Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 2 Jun 2006 22:59:24 +0000 Subject: [PATCH] some additions to kelondroCollection git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2172 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../anomic/kelondro/kelondroCollection.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/de/anomic/kelondro/kelondroCollection.java b/source/de/anomic/kelondro/kelondroCollection.java index f3a142b5c..f950a377d 100644 --- a/source/de/anomic/kelondro/kelondroCollection.java +++ b/source/de/anomic/kelondro/kelondroCollection.java @@ -85,6 +85,32 @@ public class kelondroCollection { } } + public long lastRead() { + return lastTimeRead; + } + + public long lastWrote() { + return lastTimeWrote; + } + + public byte[] get(int index) { + assert (index < chunkcount); + byte[] a = new byte[chunksize]; + synchronized (chunkcache) { + System.arraycopy(chunkcache, index * chunksize, a, 0, chunksize); + } + return a; + } + + public byte[] get(byte[] key) { + assert (key.length <= chunksize); + synchronized (chunkcache) { + int i = find(key); + if (i >= 0) return get(i); + } + return null; + } + public void add(byte[] a) { assert (a.length <= chunksize); synchronized (chunkcache) {