Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d0be5fd0
提交
d0be5fd0
authored
9月 01, 2015
作者:
Thomas Mueller Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatting, code style
上级
6cdd1755
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
93 行增加
和
87 行删除
+93
-87
TestTableEngines.java
h2/src/test/org/h2/test/db/TestTableEngines.java
+93
-87
没有找到文件。
h2/src/test/org/h2/test/db/TestTableEngines.java
浏览文件 @
d0be5fd0
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论