new Class[]{from.getClass()},
new Object[]{from});
m_readWriteLock.readLock().acquire();
try {
final BTreeObjectIterator iterator =
m_database.createIterator((BTreeIndex)indexFrom);
if (!iterator.moveTo((KeyObject)fromFactory.newInstance())) {
throw new RuntimeException("record " + from + " does not exist");
}
do {
final Object item = iterator.getObject();
if (item != null) {
col.add(item);
}
else {
break;
}
final Object keyFieldValue =
keyMethodTo.invoke(item, new Object[]{});
if (((Comparable)keyFieldValue).compareTo(to) == 0) {
break;
}
}
while (iterator.moveNext());
}
finally {
m_readWriteLock.readLock().release();
}
}