@Test public void testPut() throws IOException, InterruptedException, DeadlockException, TransactionRolledBackException { Database db = new DisklessTestDatabase(FACTORY); OrderedMap map = db.createMap(MAP_NAME, RecordFactory.simpleRecordFactory(TestKey.class, TestRecord.class)); for (int i = 0; i < N; i++) { AbstractRecord replaced = map.put(TestRecord.createRecord(i, "first")); assertNull(replaced); } for (int i = 0; i < N; i++) { AbstractRecord replaced = map.put(TestRecord.createRecord(i, "second")); assertEquals(i, ((TestKey) replaced.key()).key()); assertEquals("first", ((TestRecord) replaced).stringValue()); } Cursor cursor = map.first(); TestRecord record; int expected = 0; while ((record = (TestRecord) cursor.next()) != null) { assertEquals(expected++, record.key().key()); assertEquals("second", record.stringValue()); } assertEquals(N, expected); db.close(); }
public abstract AbstractRecord put(AbstractRecord record) throws IOException, InterruptedException, DeadlockException, TransactionRolledBackException;
OrderedMap { public abstract AbstractRecord put(AbstractRecord record) throws IOException, InterruptedException, DeadlockException, TransactionRolledBackException; }
OrderedMap { public abstract AbstractRecord put(AbstractRecord record) throws IOException, InterruptedException, DeadlockException, TransactionRolledBackException;  }
OrderedMap { public abstract AbstractRecord put(AbstractRecord record) throws IOException, InterruptedException, DeadlockException, TransactionRolledBackException;  abstract void ensurePresent(AbstractRecord record); abstract AbstractRecord put(AbstractRecord record); abstract void ensureAbsent(AbstractKey key); abstract AbstractRecord delete(AbstractKey key); abstract void lock(AbstractKey key); abstract AbstractRecord find(AbstractKey key); abstract Cursor cursor(AbstractKey key); abstract Cursor first(); abstract Cursor last(); }
OrderedMap { public abstract AbstractRecord put(AbstractRecord record) throws IOException, InterruptedException, DeadlockException, TransactionRolledBackException;  abstract void ensurePresent(AbstractRecord record); abstract AbstractRecord put(AbstractRecord record); abstract void ensureAbsent(AbstractKey key); abstract AbstractRecord delete(AbstractKey key); abstract void lock(AbstractKey key); abstract AbstractRecord find(AbstractKey key); abstract Cursor cursor(AbstractKey key); abstract Cursor first(); abstract Cursor last();  }