Package com.io7m.jspatial.api.quadtrees
Interface QuadTreeDType<A>
-
- Type Parameters:
A- The precise type of quadtree members
- All Superinterfaces:
QuadTreeReadableDType<A>,QuadTreeReadableType
- All Known Implementing Classes:
QuadTreeD
public interface QuadTreeDType<A> extends QuadTreeReadableDType<A>
The type of mutable quadtrees withdoubleprecision coordinates.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Remove all objects from the tree.booleaninsert(A item, com.io7m.jregions.core.unparameterized.areas.AreaD bounds)Insert the objectiteminto the quadtree.<B> QuadTreeDType<B>map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.areas.AreaD,B> f)Applyfto each element of the tree.booleanremove(A item)Remove the objectitemfrom the quadtree.voidtrim()Trim all empty quadrants from the tree.-
Methods inherited from interface com.io7m.jspatial.api.quadtrees.QuadTreeReadableDType
areaFor, bounds, containedBy, contains, iterateQuadrants, overlappedBy, raycast
-
Methods inherited from interface com.io7m.jspatial.api.quadtrees.QuadTreeReadableType
isEmpty, size
-
-
-
-
Method Detail
-
insert
boolean insert(A item, com.io7m.jregions.core.unparameterized.areas.AreaD bounds)
Insert the object
iteminto the quadtree.The function returns
falseif the object could not be inserted for any reason (perhaps due to being too large).- Parameters:
item- The object to insertbounds- The object's bounds- Returns:
trueif the object was inserted
-
remove
boolean remove(A item)
Remove the object
itemfrom the quadtree.The function returns
falseif the object could not be removed for any reason (perhaps due to not being in the tree in the first place).- Parameters:
item- The object to remove- Returns:
trueif the object was removed
-
clear
void clear()
Remove all objects from the tree.
-
trim
void trim()
Trim all empty quadrants from the tree.
-
map
<B> QuadTreeDType<B> map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.areas.AreaD,B> f)
Applyfto each element of the tree.- Specified by:
mapin interfaceQuadTreeReadableDType<A>- Type Parameters:
B- The type of result elements- Parameters:
f- A mapping function- Returns:
- A new tree
-
-