Package com.io7m.jspatial.api.quadtrees
Class QuadTreeConfigurationD
- java.lang.Object
-
- com.io7m.jspatial.api.quadtrees.QuadTreeConfigurationD
-
- All Implemented Interfaces:
QuadTreeConfigurationDType
public final class QuadTreeConfigurationD extends java.lang.Object implements QuadTreeConfigurationDType
The type of double precision quadtree configurations.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuadTreeConfigurationD.BuilderBuilds instances of typeQuadTreeConfigurationD.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.io7m.jregions.core.unparameterized.areas.AreaDarea()static QuadTreeConfigurationD.Builderbuilder()Creates a builder forQuadTreeConfigurationD.static QuadTreeConfigurationDcopyOf(QuadTreeConfigurationDType instance)Creates an immutable copy of aQuadTreeConfigurationDTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofQuadTreeConfigurationDthat have equal attribute values.inthashCode()Computes a hash code from attributes:area,minimumQuadrantWidth,minimumQuadrantHeight,trimOnRemove.doubleminimumQuadrantHeight()doubleminimumQuadrantWidth()static QuadTreeConfigurationDof(com.io7m.jregions.core.unparameterized.areas.AreaD area, double minimumQuadrantWidth, double minimumQuadrantHeight, boolean trimOnRemove)Construct a new immutableQuadTreeConfigurationDinstance.java.lang.StringtoString()Prints the immutable valueQuadTreeConfigurationDwith attribute values.booleantrimOnRemove()QuadTreeConfigurationDwithArea(com.io7m.jregions.core.unparameterized.areas.AreaD value)Copy the current immutable object by setting a value for theareaattribute.QuadTreeConfigurationDwithMinimumQuadrantHeight(double value)Copy the current immutable object by setting a value for theminimumQuadrantHeightattribute.QuadTreeConfigurationDwithMinimumQuadrantWidth(double value)Copy the current immutable object by setting a value for theminimumQuadrantWidthattribute.QuadTreeConfigurationDwithTrimOnRemove(boolean value)Copy the current immutable object by setting a value for thetrimOnRemoveattribute.
-
-
-
Method Detail
-
area
public com.io7m.jregions.core.unparameterized.areas.AreaD area()
- Specified by:
areain interfaceQuadTreeConfigurationDType- Returns:
- The maximum bounding area of the tree
-
minimumQuadrantWidth
public double minimumQuadrantWidth()
- Specified by:
minimumQuadrantWidthin interfaceQuadTreeConfigurationDType- Returns:
- The minimum width of quadrants (must be
>= 0.0001)
-
minimumQuadrantHeight
public double minimumQuadrantHeight()
- Specified by:
minimumQuadrantHeightin interfaceQuadTreeConfigurationDType- Returns:
- The minimum height of quadrants (must be
>= 0.0001)
-
trimOnRemove
public boolean trimOnRemove()
- Specified by:
trimOnRemovein interfaceQuadTreeConfigurationDType- Returns:
trueiff the implementation should attempt to trim empty leaf nodes when an item is removed
-
withArea
public final QuadTreeConfigurationD withArea(com.io7m.jregions.core.unparameterized.areas.AreaD value)
Copy the current immutable object by setting a value for theareaattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for area- Returns:
- A modified copy of the
thisobject
-
withMinimumQuadrantWidth
public final QuadTreeConfigurationD withMinimumQuadrantWidth(double value)
Copy the current immutable object by setting a value for theminimumQuadrantWidthattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumQuadrantWidth- Returns:
- A modified copy of the
thisobject
-
withMinimumQuadrantHeight
public final QuadTreeConfigurationD withMinimumQuadrantHeight(double value)
Copy the current immutable object by setting a value for theminimumQuadrantHeightattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumQuadrantHeight- Returns:
- A modified copy of the
thisobject
-
withTrimOnRemove
public final QuadTreeConfigurationD withTrimOnRemove(boolean value)
Copy the current immutable object by setting a value for thetrimOnRemoveattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for trimOnRemove- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofQuadTreeConfigurationDthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:area,minimumQuadrantWidth,minimumQuadrantHeight,trimOnRemove.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueQuadTreeConfigurationDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static QuadTreeConfigurationD of(com.io7m.jregions.core.unparameterized.areas.AreaD area, double minimumQuadrantWidth, double minimumQuadrantHeight, boolean trimOnRemove)
Construct a new immutableQuadTreeConfigurationDinstance.- Parameters:
area- The value for theareaattributeminimumQuadrantWidth- The value for theminimumQuadrantWidthattributeminimumQuadrantHeight- The value for theminimumQuadrantHeightattributetrimOnRemove- The value for thetrimOnRemoveattribute- Returns:
- An immutable QuadTreeConfigurationD instance
-
copyOf
public static QuadTreeConfigurationD copyOf(QuadTreeConfigurationDType instance)
Creates an immutable copy of aQuadTreeConfigurationDTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable QuadTreeConfigurationD instance
-
builder
public static QuadTreeConfigurationD.Builder builder()
Creates a builder forQuadTreeConfigurationD.- Returns:
- A new QuadTreeConfigurationD builder
-
-