Package com.io7m.jspatial.api.octtrees
Class OctTreeConfigurationI
- java.lang.Object
-
- com.io7m.jspatial.api.octtrees.OctTreeConfigurationI
-
- All Implemented Interfaces:
OctTreeConfigurationIType
public final class OctTreeConfigurationI extends java.lang.Object implements OctTreeConfigurationIType
The type of integer octtree configurations.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOctTreeConfigurationI.BuilderBuilds instances of typeOctTreeConfigurationI.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OctTreeConfigurationI.Builderbuilder()Creates a builder forOctTreeConfigurationI.static OctTreeConfigurationIcopyOf(OctTreeConfigurationIType instance)Creates an immutable copy of aOctTreeConfigurationITypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofOctTreeConfigurationIthat have equal attribute values.inthashCode()Computes a hash code from attributes:volume,minimumOctantWidth,minimumOctantHeight,minimumOctantDepth,trimOnRemove.intminimumOctantDepth()intminimumOctantHeight()intminimumOctantWidth()static OctTreeConfigurationIof(com.io7m.jregions.core.unparameterized.volumes.VolumeI volume, int minimumOctantWidth, int minimumOctantHeight, int minimumOctantDepth, boolean trimOnRemove)Construct a new immutableOctTreeConfigurationIinstance.java.lang.StringtoString()Prints the immutable valueOctTreeConfigurationIwith attribute values.booleantrimOnRemove()com.io7m.jregions.core.unparameterized.volumes.VolumeIvolume()OctTreeConfigurationIwithMinimumOctantDepth(int value)Copy the current immutable object by setting a value for theminimumOctantDepthattribute.OctTreeConfigurationIwithMinimumOctantHeight(int value)Copy the current immutable object by setting a value for theminimumOctantHeightattribute.OctTreeConfigurationIwithMinimumOctantWidth(int value)Copy the current immutable object by setting a value for theminimumOctantWidthattribute.OctTreeConfigurationIwithTrimOnRemove(boolean value)Copy the current immutable object by setting a value for thetrimOnRemoveattribute.OctTreeConfigurationIwithVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeI value)Copy the current immutable object by setting a value for thevolumeattribute.
-
-
-
Method Detail
-
volume
public com.io7m.jregions.core.unparameterized.volumes.VolumeI volume()
- Specified by:
volumein interfaceOctTreeConfigurationIType- Returns:
- The maximum bounding volume of the tree
-
minimumOctantWidth
public int minimumOctantWidth()
- Specified by:
minimumOctantWidthin interfaceOctTreeConfigurationIType- Returns:
- The minimum width of octants (must be
>= 2)
-
minimumOctantHeight
public int minimumOctantHeight()
- Specified by:
minimumOctantHeightin interfaceOctTreeConfigurationIType- Returns:
- The minimum height of octants (must be
>= 2)
-
minimumOctantDepth
public int minimumOctantDepth()
- Specified by:
minimumOctantDepthin interfaceOctTreeConfigurationIType- Returns:
- The minimum depth of octants (must be
>= 2)
-
trimOnRemove
public boolean trimOnRemove()
- Specified by:
trimOnRemovein interfaceOctTreeConfigurationIType- Returns:
trueiff the implementation should attempt to trim empty leaf nodes when an item is removed
-
withVolume
public final OctTreeConfigurationI withVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeI value)
Copy the current immutable object by setting a value for thevolumeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for volume- Returns:
- A modified copy of the
thisobject
-
withMinimumOctantWidth
public final OctTreeConfigurationI withMinimumOctantWidth(int value)
Copy the current immutable object by setting a value for theminimumOctantWidthattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumOctantWidth- Returns:
- A modified copy of the
thisobject
-
withMinimumOctantHeight
public final OctTreeConfigurationI withMinimumOctantHeight(int value)
Copy the current immutable object by setting a value for theminimumOctantHeightattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumOctantHeight- Returns:
- A modified copy of the
thisobject
-
withMinimumOctantDepth
public final OctTreeConfigurationI withMinimumOctantDepth(int value)
Copy the current immutable object by setting a value for theminimumOctantDepthattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumOctantDepth- Returns:
- A modified copy of the
thisobject
-
withTrimOnRemove
public final OctTreeConfigurationI 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 ofOctTreeConfigurationIthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:volume,minimumOctantWidth,minimumOctantHeight,minimumOctantDepth,trimOnRemove.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueOctTreeConfigurationIwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static OctTreeConfigurationI of(com.io7m.jregions.core.unparameterized.volumes.VolumeI volume, int minimumOctantWidth, int minimumOctantHeight, int minimumOctantDepth, boolean trimOnRemove)
Construct a new immutableOctTreeConfigurationIinstance.- Parameters:
volume- The value for thevolumeattributeminimumOctantWidth- The value for theminimumOctantWidthattributeminimumOctantHeight- The value for theminimumOctantHeightattributeminimumOctantDepth- The value for theminimumOctantDepthattributetrimOnRemove- The value for thetrimOnRemoveattribute- Returns:
- An immutable OctTreeConfigurationI instance
-
copyOf
public static OctTreeConfigurationI copyOf(OctTreeConfigurationIType instance)
Creates an immutable copy of aOctTreeConfigurationITypevalue. 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 OctTreeConfigurationI instance
-
builder
public static OctTreeConfigurationI.Builder builder()
Creates a builder forOctTreeConfigurationI.- Returns:
- A new OctTreeConfigurationI builder
-
-