Package com.io7m.jspatial.api.quadtrees
Class QuadTreeConfigurationL
- java.lang.Object
-
- com.io7m.jspatial.api.quadtrees.QuadTreeConfigurationL
-
- All Implemented Interfaces:
QuadTreeConfigurationLType
public final class QuadTreeConfigurationL extends java.lang.Object implements QuadTreeConfigurationLType
The type of long integer quadtree configurations.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuadTreeConfigurationL.BuilderBuilds instances of typeQuadTreeConfigurationL.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.io7m.jregions.core.unparameterized.areas.AreaLarea()static QuadTreeConfigurationL.Builderbuilder()Creates a builder forQuadTreeConfigurationL.static QuadTreeConfigurationLcopyOf(QuadTreeConfigurationLType instance)Creates an immutable copy of aQuadTreeConfigurationLTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofQuadTreeConfigurationLthat have equal attribute values.inthashCode()Computes a hash code from attributes:area,minimumQuadrantWidth,minimumQuadrantHeight,trimOnRemove.longminimumQuadrantHeight()longminimumQuadrantWidth()static QuadTreeConfigurationLof(com.io7m.jregions.core.unparameterized.areas.AreaL area, long minimumQuadrantWidth, long minimumQuadrantHeight, boolean trimOnRemove)Construct a new immutableQuadTreeConfigurationLinstance.java.lang.StringtoString()Prints the immutable valueQuadTreeConfigurationLwith attribute values.booleantrimOnRemove()QuadTreeConfigurationLwithArea(com.io7m.jregions.core.unparameterized.areas.AreaL value)Copy the current immutable object by setting a value for theareaattribute.QuadTreeConfigurationLwithMinimumQuadrantHeight(long value)Copy the current immutable object by setting a value for theminimumQuadrantHeightattribute.QuadTreeConfigurationLwithMinimumQuadrantWidth(long value)Copy the current immutable object by setting a value for theminimumQuadrantWidthattribute.QuadTreeConfigurationLwithTrimOnRemove(boolean value)Copy the current immutable object by setting a value for thetrimOnRemoveattribute.
-
-
-
Method Detail
-
area
public com.io7m.jregions.core.unparameterized.areas.AreaL area()
- Specified by:
areain interfaceQuadTreeConfigurationLType- Returns:
- The maximum bounding area of the tree
-
minimumQuadrantWidth
public long minimumQuadrantWidth()
- Specified by:
minimumQuadrantWidthin interfaceQuadTreeConfigurationLType- Returns:
- The minimum width of quadrants (must be
>= 2)
-
minimumQuadrantHeight
public long minimumQuadrantHeight()
- Specified by:
minimumQuadrantHeightin interfaceQuadTreeConfigurationLType- Returns:
- The minimum height of quadrants (must be
>= 2)
-
trimOnRemove
public boolean trimOnRemove()
- Specified by:
trimOnRemovein interfaceQuadTreeConfigurationLType- Returns:
trueiff the implementation should attempt to trim empty leaf nodes when an item is removed
-
withArea
public final QuadTreeConfigurationL withArea(com.io7m.jregions.core.unparameterized.areas.AreaL 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 QuadTreeConfigurationL withMinimumQuadrantWidth(long 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 QuadTreeConfigurationL withMinimumQuadrantHeight(long 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 QuadTreeConfigurationL 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 ofQuadTreeConfigurationLthat 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 valueQuadTreeConfigurationLwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static QuadTreeConfigurationL of(com.io7m.jregions.core.unparameterized.areas.AreaL area, long minimumQuadrantWidth, long minimumQuadrantHeight, boolean trimOnRemove)
Construct a new immutableQuadTreeConfigurationLinstance.- Parameters:
area- The value for theareaattributeminimumQuadrantWidth- The value for theminimumQuadrantWidthattributeminimumQuadrantHeight- The value for theminimumQuadrantHeightattributetrimOnRemove- The value for thetrimOnRemoveattribute- Returns:
- An immutable QuadTreeConfigurationL instance
-
copyOf
public static QuadTreeConfigurationL copyOf(QuadTreeConfigurationLType instance)
Creates an immutable copy of aQuadTreeConfigurationLTypevalue. 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 QuadTreeConfigurationL instance
-
builder
public static QuadTreeConfigurationL.Builder builder()
Creates a builder forQuadTreeConfigurationL.- Returns:
- A new QuadTreeConfigurationL builder
-
-