public String getKeys () { StringBuilder sb = new StringBuilder(); try { FastIterator iter = htree.keys (); Object obj; while ( (obj = iter.next()) != null) { if (sb.length() > 0) sb.append (' '); sb.append (obj.toString()); } } catch (IOException e) { throw new SpaceError (e); } return sb.toString(); }
@Override public Set<Object> loadAllKeys(Set<Object> keysToExclude) throws CacheLoaderException { try { Set<Object> s = new HashSet<Object>(); FastIterator fi = tree.keys(); Object o; while ((o = fi.next()) != null) if (keysToExclude == null || !keysToExclude.contains(o)) s.add(o); return s; } catch (IOException e) { throw new CacheLoaderException(e); } }
@Override public boolean hasNext() { if (current == null && next) { Object key = fi.next(); if (key == null) { next = false; } else { try { current = unmarshall(tree.get(key), key); } catch (IOException e) { throw new CacheException(e); } catch (ClassNotFoundException e) { throw new CacheException(e); } } } if (next == true && entriesReturned >= maxSize && maxSize > -1) next = false; return next; }
while ( (obj = iter.next()) != null) { ((Space)this).out (GCKEY, obj, TIMEOUT); Thread.yield ();