public class Table extends Object implements Iterable<Record>, Closeable
| Modifier and Type | Field and Description |
|---|---|
static String |
FILENAME_EXTENSION |
static String |
FILENAME_PREFIX |
| Constructor and Description |
|---|
Table(Schema schema,
String tableName) |
Table(Schema schema,
String tableName,
String filenamePrefix)
This constructor is used for creating a table in some specified directory.
|
Table(String tableName) |
Table(String tableName,
String filenamePrefix) |
| Modifier and Type | Method and Description |
|---|---|
RecordID |
addRecord(List<DataBox> values)
Adds a new record to this table.
|
void |
close() |
Record |
deleteRecord(RecordID rid)
Deletes the record specified by rid from the table.
|
int |
getNumEntriesPerPage() |
Record |
getRecord(RecordID rid)
Retrieves a record from the table.
|
Schema |
getSchema() |
Iterator<Record> |
iterator() |
Record |
updateRecord(List<DataBox> values,
RecordID rid)
Updates an existing record with new values and returns the old version of the record.
|
public static final String FILENAME_PREFIX
public static final String FILENAME_EXTENSION
public Table(String tableName)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic RecordID addRecord(List<DataBox> values) throws DatabaseException
values - the values of the record being addedDatabaseException - if the values passed in to this method do not
correspond to the schema of this tablepublic Record deleteRecord(RecordID rid) throws DatabaseException
rid - the RecordID of the record to deleteDatabaseException - if rid does not correspond to a valid recordpublic Record getRecord(RecordID rid) throws DatabaseException
rid - the RecordID of the record to retrieveDatabaseException - if rid does not correspond to a valid recordpublic Record updateRecord(List<DataBox> values, RecordID rid) throws DatabaseException
values - the new values of the recordrid - the RecordID of the record to updateDatabaseException - if rid does not correspond to a valid record or
if the values do not correspond to the schema of this tablepublic int getNumEntriesPerPage()
public Schema getSchema()
Copyright © 2017. All rights reserved.