Package mdbtools.dbengine
Class MemoryData
- java.lang.Object
-
- mdbtools.dbengine.MemoryData
-
- All Implemented Interfaces:
Data
- Direct Known Subclasses:
RewindableData
public class MemoryData extends Object implements Data
An implementation of Data that stores the complete result in memory
-
-
Field Summary
Fields Modifier and Type Field Description protected int
currentRow
-
Constructor Summary
Constructors Constructor Description MemoryData()
MemoryData(Data data, int numColumns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRow(Object[] row)
Add a row of datavoid
dump()
Object
get(int index)
get the data at a certain columnObject[]
getRow(int index)
boolean
next()
goto the next (or first) rowvoid
sort(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 SQLException
- Throws:
SQLException
-
-
Method Detail
-
next
public boolean next() throws SQLException
goto the next (or first) row- Specified by:
next
in interfaceData
- Returns:
- true if row exits, false if not
- Throws:
SQLException
-
get
public Object get(int index)
get the data at a certain column
-
getRow
public Object[] getRow(int index)
-
addRow
public void addRow(Object[] row)
Add a row of data
-
sort
public void sort(int[] sortBy, boolean[] ascending) throws SQLException
sort the data set by the given columns each column is sorted seperate- Throws:
SQLException
-
dump
public void dump()
-
-