Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
0dae0b0b
提交
0dae0b0b
authored
8月 12, 2013
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatting.
上级
73a69194
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
17 行增加
和
15 行删除
+17
-15
Parser.java
h2/src/main/org/h2/command/Parser.java
+2
-2
Comparison.java
h2/src/main/org/h2/expression/Comparison.java
+2
-2
IndexCondition.java
h2/src/main/org/h2/index/IndexCondition.java
+1
-1
IndexCursor.java
h2/src/main/org/h2/index/IndexCursor.java
+4
-2
SpatialTreeIndex.java
h2/src/main/org/h2/index/SpatialTreeIndex.java
+8
-8
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
0dae0b0b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
*
*
* Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
* Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
* Support for the operator "&&" as an alias for SPATIAL_INTERSECTS
* Support for the operator "&&" as an alias for SPATIAL_INTERSECTS
*/
*/
...
@@ -149,7 +149,7 @@ import org.h2.value.ValueTimestamp;
...
@@ -149,7 +149,7 @@ import org.h2.value.ValueTimestamp;
/**
/**
* The parser is used to convert a SQL statement string to an command object.
* The parser is used to convert a SQL statement string to an command object.
*
*
* @author Thomas Mueller
* @author Thomas Mueller
* @author Noel Grandin
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
...
...
h2/src/main/org/h2/expression/Comparison.java
浏览文件 @
0dae0b0b
...
@@ -22,7 +22,7 @@ import org.h2.value.ValueNull;
...
@@ -22,7 +22,7 @@ import org.h2.value.ValueNull;
/**
/**
* Example comparison expressions are ID=1, NAME=NAME, NAME IS NULL.
* Example comparison expressions are ID=1, NAME=NAME, NAME IS NULL.
*
*
* @author Thomas Mueller
* @author Thomas Mueller
* @author Noel Grandin
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
...
@@ -329,7 +329,7 @@ public class Comparison extends Condition {
...
@@ -329,7 +329,7 @@ public class Comparison extends Condition {
int
type
=
getNotCompareType
();
int
type
=
getNotCompareType
();
return
new
Comparison
(
session
,
type
,
left
,
right
);
return
new
Comparison
(
session
,
type
,
left
,
right
);
}
}
private
int
getNotCompareType
()
{
private
int
getNotCompareType
()
{
switch
(
compareType
)
{
switch
(
compareType
)
{
case
EQUAL:
case
EQUAL:
...
...
h2/src/main/org/h2/index/IndexCondition.java
浏览文件 @
0dae0b0b
...
@@ -29,7 +29,7 @@ import org.h2.value.Value;
...
@@ -29,7 +29,7 @@ import org.h2.value.Value;
* A index condition object is made for each condition that can potentially use
* A index condition object is made for each condition that can potentially use
* an index. This class does not extend expression, but in general there is one
* an index. This class does not extend expression, but in general there is one
* expression that maps to each index condition.
* expression that maps to each index condition.
*
*
* @author Thomas Mueller
* @author Thomas Mueller
* @author Noel Grandin
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
...
...
h2/src/main/org/h2/index/IndexCursor.java
浏览文件 @
0dae0b0b
...
@@ -26,7 +26,7 @@ import org.h2.value.ValueNull;
...
@@ -26,7 +26,7 @@ import org.h2.value.ValueNull;
/**
/**
* The filter used to walk through an index. This class supports IN(..)
* The filter used to walk through an index. This class supports IN(..)
* and IN(SELECT ...) optimizations.
* and IN(SELECT ...) optimizations.
*
*
* @author Thomas Mueller
* @author Thomas Mueller
* @author Noel Grandin
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
...
@@ -182,7 +182,9 @@ public class IndexCursor implements Cursor {
...
@@ -182,7 +182,9 @@ public class IndexCursor implements Cursor {
if
(
row
==
null
)
{
if
(
row
==
null
)
{
row
=
table
.
getTemplateRow
();
row
=
table
.
getTemplateRow
();
}
else
if
(
row
.
getValue
(
columnId
)
!=
null
)
{
}
else
if
(
row
.
getValue
(
columnId
)
!=
null
)
{
// the union of the two envelopes
// if an object needs to overlap with both a and b,
// then it needs to overlap with the the union of a and b
// (not the intersection)
ValueGeometry
vg
=
(
ValueGeometry
)
row
.
getValue
(
columnId
).
convertTo
(
Value
.
GEOMETRY
);
ValueGeometry
vg
=
(
ValueGeometry
)
row
.
getValue
(
columnId
).
convertTo
(
Value
.
GEOMETRY
);
v
=
((
ValueGeometry
)
v
.
convertTo
(
Value
.
GEOMETRY
)).
getEnvelopeUnion
(
vg
);
v
=
((
ValueGeometry
)
v
.
convertTo
(
Value
.
GEOMETRY
)).
getEnvelopeUnion
(
vg
);
}
}
...
...
h2/src/main/org/h2/index/SpatialTreeIndex.java
浏览文件 @
0dae0b0b
...
@@ -35,7 +35,7 @@ import com.vividsolutions.jts.geom.Geometry;
...
@@ -35,7 +35,7 @@ import com.vividsolutions.jts.geom.Geometry;
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
*/
*/
public
class
SpatialTreeIndex
extends
BaseIndex
implements
SpatialIndex
{
public
class
SpatialTreeIndex
extends
BaseIndex
implements
SpatialIndex
{
private
static
final
String
MAP_PREFIX
=
"RTREE_"
;
private
static
final
String
MAP_PREFIX
=
"RTREE_"
;
private
final
MVRTreeMap
<
Long
>
treeMap
;
private
final
MVRTreeMap
<
Long
>
treeMap
;
...
@@ -45,10 +45,10 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
...
@@ -45,10 +45,10 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
private
boolean
closed
;
private
boolean
closed
;
private
boolean
needRebuild
;
private
boolean
needRebuild
;
private
boolean
persistent
;
private
boolean
persistent
;
/**
/**
* Constructor.
* Constructor.
*
*
* @param table the table instance
* @param table the table instance
* @param id the index id
* @param id the index id
* @param indexName the index name
* @param indexName the index name
...
@@ -127,13 +127,13 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
...
@@ -127,13 +127,13 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
}
}
treeMap
.
add
(
getEnvelope
(
row
),
row
.
getKey
());
treeMap
.
add
(
getEnvelope
(
row
),
row
.
getKey
());
}
}
private
SpatialKey
getEnvelope
(
SearchRow
row
)
{
private
SpatialKey
getEnvelope
(
SearchRow
row
)
{
Value
v
=
row
.
getValue
(
columnIds
[
0
]);
Value
v
=
row
.
getValue
(
columnIds
[
0
]);
Geometry
g
=
((
ValueGeometry
)
v
.
convertTo
(
Value
.
GEOMETRY
)).
getGeometry
();
Geometry
g
=
((
ValueGeometry
)
v
.
convertTo
(
Value
.
GEOMETRY
)).
getGeometry
();
Envelope
env
=
g
.
getEnvelopeInternal
();
Envelope
env
=
g
.
getEnvelopeInternal
();
return
new
SpatialKey
(
row
.
getKey
(),
return
new
SpatialKey
(
row
.
getKey
(),
(
float
)
env
.
getMinX
(),
(
float
)
env
.
getMaxX
(),
(
float
)
env
.
getMinX
(),
(
float
)
env
.
getMaxX
(),
(
float
)
env
.
getMinY
(),
(
float
)
env
.
getMaxY
());
(
float
)
env
.
getMinY
(),
(
float
)
env
.
getMaxY
());
}
}
...
@@ -160,7 +160,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
...
@@ -160,7 +160,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
private
Cursor
find
(
Session
session
)
{
private
Cursor
find
(
Session
session
)
{
return
new
SpatialCursor
(
treeMap
.
keySet
().
iterator
(),
tableData
,
session
);
return
new
SpatialCursor
(
treeMap
.
keySet
().
iterator
(),
tableData
,
session
);
}
}
@Override
@Override
public
Cursor
findByGeometry
(
TableFilter
filter
,
SearchRow
intersection
)
{
public
Cursor
findByGeometry
(
TableFilter
filter
,
SearchRow
intersection
)
{
if
(
intersection
==
null
)
{
if
(
intersection
==
null
)
{
...
@@ -250,7 +250,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
...
@@ -250,7 +250,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
* A cursor to iterate over spatial keys.
* A cursor to iterate over spatial keys.
*/
*/
private
static
final
class
SpatialCursor
implements
Cursor
{
private
static
final
class
SpatialCursor
implements
Cursor
{
private
final
Iterator
<
SpatialKey
>
it
;
private
final
Iterator
<
SpatialKey
>
it
;
private
SpatialKey
current
;
private
SpatialKey
current
;
private
final
RegularTable
tableData
;
private
final
RegularTable
tableData
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论