提交 d0be5fd0 authored 作者: Thomas Mueller Graf's avatar Thomas Mueller Graf

Formatting, code style

上级 6cdd1755
...@@ -367,7 +367,7 @@ public class TestTableEngines extends TestBase { ...@@ -367,7 +367,7 @@ public class TestTableEngines extends TestBase {
} }
} }
private List<List<Object>> query(List<List<Object>> dataSet, RowFilter filter, RowComparator sort) { private static List<List<Object>> query(List<List<Object>> dataSet, RowFilter filter, RowComparator sort) {
List<List<Object>> res = New.arrayList(); List<List<Object>> res = New.arrayList();
if (filter == null) { if (filter == null) {
res.addAll(dataSet); res.addAll(dataSet);
...@@ -384,7 +384,7 @@ public class TestTableEngines extends TestBase { ...@@ -384,7 +384,7 @@ public class TestTableEngines extends TestBase {
return res; return res;
} }
private List<List<Object>> query(Statement stat, String qry) throws SQLException { private static List<List<Object>> query(Statement stat, String qry) throws SQLException {
ResultSet rs = stat.executeQuery(qry); ResultSet rs = stat.executeQuery(qry);
int cols = rs.getMetaData().getColumnCount(); int cols = rs.getMetaData().getColumnCount();
List<List<Object>> list = New.arrayList(); List<List<Object>> list = New.arrayList();
...@@ -697,6 +697,7 @@ public class TestTableEngines extends TestBase { ...@@ -697,6 +697,7 @@ public class TestTableEngines extends TestBase {
} }
/** /**
* A table engine that internally uses a tree set.
*/ */
public static class TreeSetIndexTableEngine implements TableEngine { public static class TreeSetIndexTableEngine implements TableEngine {
@Override @Override
...@@ -706,6 +707,7 @@ public class TestTableEngines extends TestBase { ...@@ -706,6 +707,7 @@ public class TestTableEngines extends TestBase {
} }
/** /**
* A table that internally uses a tree set.
*/ */
private static class TreeSetTable extends TableBase { private static class TreeSetTable extends TableBase {
int dataMoficationId; int dataMoficationId;
...@@ -866,9 +868,10 @@ public class TestTableEngines extends TestBase { ...@@ -866,9 +868,10 @@ public class TestTableEngines extends TestBase {
} }
/** /**
* An index that internally uses a tree set.
*/ */
private static class TreeSetIndex extends BaseIndex implements Comparator<SearchRow> { private static class TreeSetIndex extends BaseIndex implements Comparator<SearchRow> {
private final TreeSet<SearchRow> set = new TreeSet<SearchRow>(this); final TreeSet<SearchRow> set = new TreeSet<SearchRow>(this);
TreeSetIndex(Table t, String name, IndexColumn[] cols, IndexType type) { TreeSetIndex(Table t, String name, IndexColumn[] cols, IndexType type) {
initBaseIndex(t, 0, name, cols, type); initBaseIndex(t, 0, name, cols, type);
...@@ -898,7 +901,7 @@ public class TestTableEngines extends TestBase { ...@@ -898,7 +901,7 @@ public class TestTableEngines extends TestBase {
set.remove(row); set.remove(row);
} }
private SearchRow mark(SearchRow row) { private static SearchRow mark(SearchRow row) {
if (row != null) { if (row != null) {
// Mark this row to be a search row. // Mark this row to be a search row.
row.setKey(Long.MAX_VALUE); row.setKey(Long.MAX_VALUE);
...@@ -1019,6 +1022,7 @@ public class TestTableEngines extends TestBase { ...@@ -1019,6 +1022,7 @@ public class TestTableEngines extends TestBase {
} }
/** /**
* A comparator for rows (lists of comparable objects).
*/ */
private static class RowComparator implements Comparator<List<Object>> { private static class RowComparator implements Comparator<List<Object>> {
private int[] cols; private int[] cols;
...@@ -1053,8 +1057,10 @@ public class TestTableEngines extends TestBase { ...@@ -1053,8 +1057,10 @@ public class TestTableEngines extends TestBase {
} }
/** /**
* A filter for rows (lists of objects).
*/ */
private abstract static class RowFilter { abstract static class RowFilter {
protected abstract boolean accept(List<Object> row); protected abstract boolean accept(List<Object> row);
protected Integer getInt(List<Object> row, int col) { protected Integer getInt(List<Object> row, int col) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论