public boolean getBoolean(Tuple t) {
return t.getFloat(HEADERS[3]) < thresh;
}
};
CascadedTable ft = new CascadedTable(t, p);
for ( int i=0, r=0; i<NROWS; ++i ) {
float val = ((Float)TABLE[3][i]).floatValue();
if ( val < thresh ) {
try {
for ( int c=0; c<NCOLS; ++c ) {
Object o1 = TABLE[c][i];
Object o2 = ft.get(r, HEADERS[c]);
assertEquals(o1, o2);
}
++r;
} catch ( Exception e ) {
fail("Caught exception: "+e);
}
}
}
// add an extra column to the cascaded table
String name = "test";
ft.addColumn(name, double.class, new Double(Math.PI));
TableIterator iter = ft.iterator();
while ( iter.hasNext() ) {
int row = iter.nextInt();
iter.setDouble(name, Math.E);
assertTrue(Math.E == ft.getDouble(row, name));
}
int nr = t.addRow();
t.setFloat(nr, HEADERS[3], 0.5f);
t.setInt(nr, HEADERS[0], 77);