提交 0dae0b0b authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting.

上级 73a69194
...@@ -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
......
...@@ -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:
......
...@@ -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
......
...@@ -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);
} }
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论