Package org.openstreetmap.josm.data.osm
Class QuadBuckets<T extends IQuadBucketType>
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.QuadBuckets<T>
-
- Type Parameters:
T
- type of object extendingIQuadBucketType
.
- All Implemented Interfaces:
java.lang.Iterable<T>
,java.util.Collection<T>
- Direct Known Subclasses:
MarkerLayer.MarkerData
public class QuadBuckets<T extends IQuadBucketType> extends java.lang.Object implements java.util.Collection<T>
Note: bbox of primitives added to QuadBuckets has to stay the same. In case of coordinate change, primitive must be removed and re-added. This class is (no longer) thread safe.- Since:
- 2165 (
IPrimitive
only), 17459 forIQuadBucketType
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
QuadBuckets.QBLevel<T extends IQuadBucketType>
(package private) class
QuadBuckets.QuadBucketIterator
-
Field Summary
Fields Modifier and Type Field Description private static boolean
CONSISTENCY_TESTING
private java.util.Collection<T>
invalidBBoxPrimitives
private static int
MAX_OBJECTS_PER_NODE
private static byte
NE_INDEX
private static byte
NW_INDEX
private QuadBuckets.QBLevel<T>
root
private static byte
SE_INDEX
private QuadBuckets.QBLevel<T>
searchCache
private int
size
private static byte
SW_INDEX
-
Constructor Summary
Constructors Constructor Description QuadBuckets()
Constructs a newQuadBuckets
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static void
abort(java.lang.String s)
boolean
add(T n)
boolean
addAll(java.util.Collection<? extends T> objects)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> objects)
boolean
isEmpty()
java.util.Iterator<T>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> objects)
boolean
retainAll(java.util.Collection<?> objects)
java.util.List<T>
search(BBox searchBbox)
Search the tree for objects in the bbox (or crossing the bbox if they are ways)int
size()
java.lang.Object[]
toArray()
<A> A[]
toArray(A[] template)
java.util.List<T>
toList()
Converts to list.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
CONSISTENCY_TESTING
private static final boolean CONSISTENCY_TESTING
- See Also:
- Constant Field Values
-
NW_INDEX
private static final byte NW_INDEX
- See Also:
- Constant Field Values
-
NE_INDEX
private static final byte NE_INDEX
- See Also:
- Constant Field Values
-
SE_INDEX
private static final byte SE_INDEX
- See Also:
- Constant Field Values
-
SW_INDEX
private static final byte SW_INDEX
- See Also:
- Constant Field Values
-
MAX_OBJECTS_PER_NODE
private static final int MAX_OBJECTS_PER_NODE
- See Also:
- Constant Field Values
-
root
private QuadBuckets.QBLevel<T extends IQuadBucketType> root
-
searchCache
private QuadBuckets.QBLevel<T extends IQuadBucketType> searchCache
-
size
private int size
-
invalidBBoxPrimitives
private java.util.Collection<T extends IQuadBucketType> invalidBBoxPrimitives
-
-
Constructor Detail
-
QuadBuckets
public QuadBuckets()
Constructs a newQuadBuckets
.
-
-
Method Detail
-
abort
static void abort(java.lang.String s)
-
clear
public final void clear()
- Specified by:
clear
in interfacejava.util.Collection<T extends IQuadBucketType>
-
add
public boolean add(T n)
- Specified by:
add
in interfacejava.util.Collection<T extends IQuadBucketType>
-
retainAll
public boolean retainAll(java.util.Collection<?> objects)
- Specified by:
retainAll
in interfacejava.util.Collection<T extends IQuadBucketType>
-
removeAll
public boolean removeAll(java.util.Collection<?> objects)
- Specified by:
removeAll
in interfacejava.util.Collection<T extends IQuadBucketType>
-
addAll
public boolean addAll(java.util.Collection<? extends T> objects)
- Specified by:
addAll
in interfacejava.util.Collection<T extends IQuadBucketType>
-
containsAll
public boolean containsAll(java.util.Collection<?> objects)
- Specified by:
containsAll
in interfacejava.util.Collection<T extends IQuadBucketType>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<T extends IQuadBucketType>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<T extends IQuadBucketType>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<T extends IQuadBucketType>
-
toArray
public <A> A[] toArray(A[] template)
- Specified by:
toArray
in interfacejava.util.Collection<T extends IQuadBucketType>
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<T extends IQuadBucketType>
- Specified by:
iterator
in interfacejava.lang.Iterable<T extends IQuadBucketType>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<T extends IQuadBucketType>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<T extends IQuadBucketType>
-
-