Package at.jku.sii.sqlitereader.btree

Source Code of at.jku.sii.sqlitereader.btree.IndexLeafBTreePage

package at.jku.sii.sqlitereader.btree;

import java.util.List;

import at.jku.sii.sqlitereader.SqliteDataBase;
import at.jku.sii.sqlitereader.btree.IndexLeafBTreePage.IndexLeafCell;
import at.jku.sii.sqlitereader.io.ArrayDataInput;
import at.jku.sii.sqlitereader.record.Record;

public final class IndexLeafBTreePage extends PayloadBTreePage<IndexLeafCell> {
  public static final class IndexLeafCell extends PayloadCell implements IndexCell {

    IndexLeafCell(ArrayDataInput in, SqliteDataBase db) {
      super(in.readVarint("numPayloadBytes"), Type.INDEX_LEAF, in, db);
    }

    @Override
    public String toString() {
      return String.format("IndexLeafCell [%s]", this.toStringAttr());
    }

  }

  IndexLeafBTreePage(int number, SqliteDataBase db, ArrayDataInput block) {
    super(number, Type.INDEX_LEAF, db, block);
  }

  @Override
  protected IndexLeafCell readCell(ArrayDataInput in, SqliteDataBase db) {
    return new IndexLeafCell(in, db);
  }

  @Override
  public void collectRecords(List<Record> records) {
    for (IndexLeafCell cell : this)
      records.add(cell.getRecord());
  }
}
TOP

Related Classes of at.jku.sii.sqlitereader.btree.IndexLeafBTreePage

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.