Package com.io7m.jspatial.api.quadtrees
Class QuadTreeConfigurationI
- java.lang.Object
-
- com.io7m.jspatial.api.quadtrees.QuadTreeConfigurationI
-
- All Implemented Interfaces:
QuadTreeConfigurationIType
public final class QuadTreeConfigurationI extends java.lang.Object implements QuadTreeConfigurationIType
The type of integer quadtree configurations.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuadTreeConfigurationI.BuilderBuilds instances of typeQuadTreeConfigurationI.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.io7m.jregions.core.unparameterized.areas.AreaIarea()static QuadTreeConfigurationI.Builderbuilder()Creates a builder forQuadTreeConfigurationI.static QuadTreeConfigurationIcopyOf(QuadTreeConfigurationIType instance)Creates an immutable copy of aQuadTreeConfigurationITypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofQuadTreeConfigurationIthat have equal attribute values.inthashCode()Computes a hash code from attributes:area,minimumQuadrantWidth,minimumQuadrantHeight,trimOnRemove.intminimumQuadrantHeight()intminimumQuadrantWidth()static QuadTreeConfigurationIof(com.io7m.jregions.core.unparameterized.areas.AreaI area, int minimumQuadrantWidth, int minimumQuadrantHeight, boolean trimOnRemove)Construct a new immutableQuadTreeConfigurationIinstance.java.lang.StringtoString()Prints the immutable valueQuadTreeConfigurationIwith attribute values.booleantrimOnRemove()QuadTreeConfigurationIwithArea(com.io7m.jregions.core.unparameterized.areas.AreaI value)Copy the current immutable object by setting a value for theareaattribute.QuadTreeConfigurationIwithMinimumQuadrantHeight(int value)Copy the current immutable object by setting a value for theminimumQuadrantHeightattribute.QuadTreeConfigurationIwithMinimumQuadrantWidth(int value)Copy the current immutable object by setting a value for theminimumQuadrantWidthattribute.QuadTreeConfigurationIwithTrimOnRemove(boolean value)Copy the current immutable object by setting a value for thetrimOnRemoveattribute.
-
-
-
Method Detail
-
area
public com.io7m.jregions.core.unparameterized.areas.AreaI area()
- Specified by:
areain interfaceQuadTreeConfigurationIType- Returns:
- The maximum bounding area of the tree
-
minimumQuadrantWidth
public int minimumQuadrantWidth()
- Specified by:
minimumQuadrantWidthin interfaceQuadTreeConfigurationIType- Returns:
- The minimum width of quadrants (must be
>= 2)
-
minimumQuadrantHeight
public int minimumQuadrantHeight()
- Specified by:
minimumQuadrantHeightin interfaceQuadTreeConfigurationIType- Returns:
- The minimum height of quadrants (must be
>= 2)
-
trimOnRemove
public boolean trimOnRemove()
- Specified by:
trimOnRemovein interfaceQuadTreeConfigurationIType- Returns:
trueiff the implementation should attempt to trim empty leaf nodes when an item is removed
-
withArea
public final QuadTreeConfigurationI withArea(com.io7m.jregions.core.unparameterized.areas.AreaI 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 QuadTreeConfigurationI withMinimumQuadrantWidth(int value)
Copy the current immutable object by setting a value for theminimumQuadrantWidthattribute. A value equality check is 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 QuadTreeConfigurationI withMinimumQuadrantHeight(int value)
Copy the current immutable object by setting a value for theminimumQuadrantHeightattribute. A value equality check is 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 QuadTreeConfigurationI 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 ofQuadTreeConfigurationIthat 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 valueQuadTreeConfigurationIwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static QuadTreeConfigurationI of(com.io7m.jregions.core.unparameterized.areas.AreaI area, int minimumQuadrantWidth, int minimumQuadrantHeight, boolean trimOnRemove)
Construct a new immutableQuadTreeConfigurationIinstance.- Parameters:
area- The value for theareaattributeminimumQuadrantWidth- The value for theminimumQuadrantWidthattributeminimumQuadrantHeight- The value for theminimumQuadrantHeightattributetrimOnRemove- The value for thetrimOnRemoveattribute- Returns:
- An immutable QuadTreeConfigurationI instance
-
copyOf
public static QuadTreeConfigurationI copyOf(QuadTreeConfigurationIType instance)
Creates an immutable copy of aQuadTreeConfigurationITypevalue. 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 QuadTreeConfigurationI instance
-
builder
public static QuadTreeConfigurationI.Builder builder()
Creates a builder forQuadTreeConfigurationI.- Returns:
- A new QuadTreeConfigurationI builder
-
-