Debian Codegraph @

src/main/org/h2/mvstore/rtree/Spatial.java

raw
1 /*
2 * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (https://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6 package org.h2.mvstore.rtree;
7
8 /**
9 * Interface Spatial represents boxes in 2+ dimensional space,
10 * where total ordering is not that straight-forward.
11 * They can be used as keys for MVRTree.
12 *
13 * @author <a href='mailto:[email protected]'>Andrei Tokar</a>
14 */
15 public interface Spatial
16 {
17 /**
18 * Get the minimum value for the given dimension.
19 *
20 * @param dim the dimension
21 * @return the value
22 */
23 float min(int dim);
24
25 /**
26 * Set the minimum value for the given dimension.
27 *
28 * @param dim the dimension
29 * @param x the value
30 */
31 void setMin(int dim, float x);
32
33 /**
34 * Get the maximum value for the given dimension.
35 *
36 * @param dim the dimension
37 * @return the value
38 */
39 float max(int dim);
40
41 /**
42 * Set the maximum value for the given dimension.
43 *
44 * @param dim the dimension
45 * @param x the value
46 */
47 void setMax(int dim, float x);
48
49 /**
50 * Creates a copy of this Spatial object with different id.
51 *
52 * @param id for the new Spatial object
53 * @return a clone
54 */
55 Spatial clone(long id);
56
57 /**
58 * Get id of this Spatial object
59 * @return id
60 */
61 long getId();
62
63 /**
64 * Test whether this object has no value
65 * @return true if it is NULL, false otherwise
66 */
67 boolean isNull();
68
69 /**
70 * Check whether two objects are equals, but do not compare the id fields.
71 *
72 * @param o the other key
73 * @return true if the contents are the same
74 */
75 boolean equalsIgnoringId(Spatial o);
76 }