use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowEntry in project linuxtools by eclipse.
the class MockDataSet method buildDataSet.
public static RowDataSet buildDataSet(int rows, int cols) {
String[] titles = new String[cols];
int i;
for (i = 0; i < cols; i++) titles[i] = "" + i;
RowDataSet data = new RowDataSet(titles);
RowEntry entry;
int j;
for (i = 0; i < rows; i++) {
Object[] d = new Object[cols];
for (j = 0; j < cols; j++) {
d[j] = i * cols + j;
}
entry = new RowEntry();
entry.putRow(0, d);
data.append(entry);
}
return data;
}
use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowEntry in project linuxtools by eclipse.
the class FilteredRowDataSetTest method testAddFilter.
// End overwrite to ensure the data returned has all the filters applied
// IFilteredDataSet Methods
@Test
public void testAddFilter() {
data.remove(0);
data.remove(0);
RowEntry entry;
entry = new RowEntry();
entry.putRow(0, new Integer[] { 3, 2, 5 });
data.append(entry);
entry = new RowEntry();
entry.putRow(0, new Integer[] { 4, 2, 3 });
data.append(entry);
entry = new RowEntry();
entry.putRow(0, new Integer[] { 7, 2, 9 });
data.append(entry);
entry = new RowEntry();
entry.putRow(0, new Integer[] { 2, 2, 6 });
data.append(entry);
entry = new RowEntry();
entry.putRow(0, new Integer[] { 5, 2, 2 });
data.append(entry);
fdata.addFilter(new RangeFilter(0, 3, 5, RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS));
assertEquals(3, fdata.getRowCount());
Object[] row = fdata.getRow(1);
assertEquals(4, ((Integer) row[0]).intValue());
assertEquals(3, ((Integer) row[2]).intValue());
row = fdata.getRow(2);
assertEquals(5, ((Integer) row[0]).intValue());
assertEquals(2, ((Integer) row[1]).intValue());
fdata.addFilter(new SortFilter(2, SortFilter.ASCENDING));
assertEquals(3, fdata.getRowCount());
row = fdata.getRow(0);
assertEquals(5, ((Integer) row[0]).intValue());
assertEquals(2, ((Integer) row[2]).intValue());
row = fdata.getRow(1);
assertEquals(4, ((Integer) row[0]).intValue());
assertEquals(3, ((Integer) row[2]).intValue());
}
use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowEntry in project linuxtools by eclipse.
the class FilteredRowDataSetTest method testRemoveFilter.
@Test
public void testRemoveFilter() {
data.remove(0);
data.remove(0);
RowEntry entry;
entry = new RowEntry();
entry.putRow(0, new Integer[] { 3, 2, 5 });
data.append(entry);
entry = new RowEntry();
entry.putRow(0, new Integer[] { 4, 2, 3 });
data.append(entry);
entry = new RowEntry();
entry.putRow(0, new Integer[] { 7, 2, 9 });
data.append(entry);
entry = new RowEntry();
entry.putRow(0, new Integer[] { 2, 2, 6 });
data.append(entry);
entry = new RowEntry();
entry.putRow(0, new Integer[] { 5, 2, 2 });
data.append(entry);
RangeFilter filter = new RangeFilter(0, 3, 5, RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
fdata.addFilter(filter);
fdata.addFilter(new SortFilter(2, SortFilter.ASCENDING));
fdata.removeFilter(filter);
assertEquals(5, fdata.getRowCount());
Object[] row = fdata.getRow(0);
assertEquals(5, ((Integer) row[0]).intValue());
assertEquals(2, ((Integer) row[2]).intValue());
row = fdata.getRow(1);
assertEquals(4, ((Integer) row[0]).intValue());
assertEquals(3, ((Integer) row[2]).intValue());
}
use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowEntry in project linuxtools by eclipse.
the class RowDataSetTest method testRemove.
@Test
public void testRemove() {
assertFalse(data.remove(null));
assertFalse(data.remove(new RowEntry()));
assertFalse(data.remove(-1));
assertFalse(data.remove(10));
assertEquals(2, data.getEntryCount());
IDataEntry entry = data.getEntry(0);
assertTrue(data.remove(entry));
assertEquals(1, data.getEntryCount());
assertFalse(data.remove(entry));
assertTrue(data.remove(0));
}
use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowEntry in project linuxtools by eclipse.
the class RowEntryTest method testGetRowCount.
@Test
public void testGetRowCount() {
RowEntry entry2 = new RowEntry();
assertEquals(0, entry2.getRowCount());
entry2 = new RowEntry();
entry2.putRow(0, null);
assertEquals(0, entry2.getRowCount());
assertEquals(1, entry.getRowCount());
}
Aggregations