public String getStringFor(T nameRecord) { int recordToFind = nameRecord.getNameId(); Iterator<DynamicRecord> records = nameRecord.getNameRecords().iterator(); Collection<DynamicRecord> relevantRecords = new ArrayList<DynamicRecord>(); while (recordToFind != Record.NO_NEXT_BLOCK.intValue() && records.hasNext()) { DynamicRecord record = records.next(); if (record.inUse() && record.getId() == recordToFind) { recordToFind = (int) record.getNextBlock(); // // TODO: optimize here, high chance next is right one relevantRecords.add(record); records = nameRecord.getNameRecords().iterator(); } } return (String) PropertyStore.getStringFor( PropertyStore.readFullByteArray(nameRecord.getNameId(), relevantRecords, nameStore)); }
private Pair<byte[], byte[]> loadArray(Collection<DynamicRecord> records) { return PropertyStore.readFullByteArray( first(records).getId(), records, arrayStore, PropertyType.ARRAY); }