if (comparator.compare(tmp_data, (byte[]) enumerationRecords.elementAt(position)) == RecordComparator.FOLLOWS) {
if (comparator.compare(tmp_data, ((EnumerationRecord) enumerationRecords.elementAt(position)).value) == RecordComparator.FOLLOWS) {
    public void rebuild()    {        enumerationRecords.removeAllElements();        int position;        for (Enumeration e = recordStoreImpl.records.keys(); e.hasMoreElements();) {            Object key = e.nextElement();            if (filter != null && !filter.matches((byte[]) recordStoreImpl.records.get(key))) {                continue;            }            byte[] tmp_data = (byte[]) recordStoreImpl.records.get(key);            // here should be better sorting            if (comparator != null) {                for (position = 0; position < enumerationRecords.size(); position++) {                    if (comparator.compare(tmp_data, (byte[]) enumerationRecords.elementAt(position)) == RecordComparator.FOLLOWS) {                        break;                    }                }            } else {                position = enumerationRecords.size();            }            enumerationRecords.insertElementAt(                    new EnumerationRecord(((Integer) key).intValue(), tmp_data), position);        }        currentRecord = 0;    }