@Test public void requireThatEntriesAreSortedOnId() { SimpleIndex.Builder builder = new SimpleIndex.Builder(); builder.insert(KEY, new Posting(DOC_ID, 10)); builder.insert(KEY, new Posting(DOC_ID - 1, 20)); builder.insert(KEY, new Posting(DOC_ID + 1, 30)); SimpleIndex index = builder.build(); SimpleIndex.Entry entry = index.getPostingList(KEY); assertEquals(3, entry.docIds.length); assertEquals(DOC_ID - 1, entry.docIds[0]); assertEquals(DOC_ID, entry.docIds[1]); assertEquals(DOC_ID + 1, entry.docIds[2]); }
public Entry getPostingList(long key) { return dictionary.get(key); }
SimpleIndex { public Entry getPostingList(long key) { return dictionary.get(key); } }
SimpleIndex { public Entry getPostingList(long key) { return dictionary.get(key); } SimpleIndex(LongObjectMap<Entry> dictionary); }
SimpleIndex { public Entry getPostingList(long key) { return dictionary.get(key); } SimpleIndex(LongObjectMap<Entry> dictionary); Entry getPostingList(long key); void writeToOutputStream(DataOutputStream out); static SimpleIndex fromInputStream(DataInputStream in); }
SimpleIndex { public Entry getPostingList(long key) { return dictionary.get(key); } SimpleIndex(LongObjectMap<Entry> dictionary); Entry getPostingList(long key); void writeToOutputStream(DataOutputStream out); static SimpleIndex fromInputStream(DataInputStream in);  }