DeletableFrameTupleAppender implements IAppendDeletableFrameTupleAccessor { @Override public void delete(int tupleIndex) { int endOffset = getTupleEndOffset(tupleIndex); if (endOffset > 0) { setTupleEndOffset(tupleIndex, -endOffset); deletedSpace += endOffset - getTupleStartOffset(tupleIndex); setDeleteSpace(deletedSpace); } } DeletableFrameTupleAppender(RecordDescriptor recordDescriptor); @Override void clear(ByteBuffer buffer); @Override void reset(ByteBuffer buffer); @Override int append(IFrameTupleAccessor tupleAccessor, int tIndex); @Override void delete(int tupleIndex); @Override void reOrganizeBuffer(); @Override int getTotalFreeSpace(); @Override int getContiguousFreeSpace(); @Override int getFieldCount(); @Override int getFieldSlotsLength(); @Override int getFieldEndOffset(int tupleIndex, int fIdx); @Override int getFieldStartOffset(int tupleIndex, int fIdx); @Override int getFieldLength(int tupleIndex, int fIdx); @Override int getTupleLength(int tupleIndex); @Override int getTupleEndOffset(int tupleIndex); @Override int getTupleStartOffset(int tupleIndex); @Override int getAbsoluteFieldStartOffset(int tupleIndex, int fIdx); @Override int getTupleCount(); @Override ByteBuffer getBuffer();  }
@Test public void testDelete() throws Exception { int count = 10; int deleteSpace = 0; ByteBuffer buffer = makeAFrame(cap, count, deleteSpace); appender.reset(buffer); int freeSpace = appender.getContiguousFreeSpace(); for (int i = 0; i < appender.getTupleCount(); i++) { deleteSpace += assertDeleteSucceed(i, freeSpace, deleteSpace); int innerOffset = deleteSpace; for (int j = i + 1; j < appender.getTupleCount(); j++) { innerOffset += assertTupleIsExpected(j, innerOffset); } } }