public class MemoryData extends Object implements Data
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentRow |
private ArrayList |
rows |
| Constructor and Description |
|---|
MemoryData() |
MemoryData(Data data,
int numColumns) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(Object[] row)
Add a row of data
|
void |
dump() |
private int |
findDifferent(int column,
int start) |
Object |
get(int index)
get the data at a certain column
|
Object[] |
getRow(int index) |
boolean |
next()
goto the next (or first) row
|
void |
sort(int[] sortBy,
boolean[] ascending)
sort the data set by the given columns
each column is sorted seperate
|
private void |
sort(int columnToSort,
int startAt,
int endAt,
boolean ascending)
sort the data by the given column using only the given rows
insertion sort is used for the sort
todo: replace with a better sorting algorithm
|
protected int currentRow
private ArrayList rows
public MemoryData()
public MemoryData(Data data, int numColumns) throws SQLException
SQLExceptionpublic boolean next()
throws SQLException
next in interface DataSQLExceptionpublic Object get(int index)
public Object[] getRow(int index)
public void addRow(Object[] row)
public void sort(int[] sortBy,
boolean[] ascending)
throws SQLException
SQLExceptionprivate int findDifferent(int column,
int start)
private void sort(int columnToSort,
int startAt,
int endAt,
boolean ascending)
columnToSort - the column to sortstartAt - the row to start sorting atendAt - the row to end sorting atascending - true for ascending order, false for descending orderpublic void dump()
Copyright © 2016 Open Microscopy Environment