Package mdbtools.dbengine
Class MemoryData
- java.lang.Object
-
- mdbtools.dbengine.MemoryData
-
- All Implemented Interfaces:
Data
- Direct Known Subclasses:
RewindableData
public class MemoryData extends java.lang.Object implements Data
An implementation of Data that stores the complete result in memory
-
-
Field Summary
Fields Modifier and Type Field Description protected intcurrentRow
-
Constructor Summary
Constructors Constructor Description MemoryData()MemoryData(Data data, int numColumns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRow(java.lang.Object[] row)Add a row of datavoiddump()java.lang.Objectget(int index)get the data at a certain columnjava.lang.Object[]getRow(int index)booleannext()goto the next (or first) rowvoidsort(int[] sortBy, boolean[] ascending)sort the data set by the given columns each column is sorted seperate
-
-
-
Constructor Detail
-
MemoryData
public MemoryData()
-
MemoryData
public MemoryData(Data data, int numColumns) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-
Method Detail
-
next
public boolean next() throws java.sql.SQLExceptiongoto the next (or first) row
-
get
public java.lang.Object get(int index)
get the data at a certain column
-
getRow
public java.lang.Object[] getRow(int index)
-
addRow
public void addRow(java.lang.Object[] row)
Add a row of data
-
sort
public void sort(int[] sortBy, boolean[] ascending) throws java.sql.SQLExceptionsort the data set by the given columns each column is sorted seperate- Throws:
java.sql.SQLException
-
dump
public void dump()
-
-