Package com.io7m.jspatial.api.quadtrees
Interface QuadTreeLType<A>
-
- Type Parameters:
A- The precise type of quadtree members
- All Superinterfaces:
QuadTreeReadableLType<A>,QuadTreeReadableType
- All Known Implementing Classes:
QuadTreeL
public interface QuadTreeLType<A> extends QuadTreeReadableLType<A>
The type of mutable quadtrees withlonginteger 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.AreaL bounds)Insert the objectiteminto the quadtree.<B> QuadTreeLType<B>map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.areas.AreaL,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.QuadTreeReadableLType
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.AreaL 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).If the object is already in the tree, it is replaced. This can be used to update the bounds of an object within the tree.
- 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> QuadTreeLType<B> map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.areas.AreaL,B> f)
Applyfto each element of the tree.- Specified by:
mapin interfaceQuadTreeReadableLType<A>- Type Parameters:
B- The type of result elements- Parameters:
f- A mapping function- Returns:
- A new tree
-
-