Package com.io7m.jspatial.api.octtrees
Class OctTreeConfigurationI.Builder
- java.lang.Object
-
- com.io7m.jspatial.api.octtrees.OctTreeConfigurationI.Builder
-
- Enclosing class:
- OctTreeConfigurationI
public static final class OctTreeConfigurationI.Builder extends java.lang.ObjectBuilds instances of typeOctTreeConfigurationI. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OctTreeConfigurationIbuild()Builds a newOctTreeConfigurationI.OctTreeConfigurationI.Builderfrom(OctTreeConfigurationIType instance)Fill a builder with attribute values from the providedOctTreeConfigurationITypeinstance.OctTreeConfigurationI.BuildersetMinimumOctantDepth(int minimumOctantDepth)Initializes the value for theminimumOctantDepthattribute.OctTreeConfigurationI.BuildersetMinimumOctantHeight(int minimumOctantHeight)Initializes the value for theminimumOctantHeightattribute.OctTreeConfigurationI.BuildersetMinimumOctantWidth(int minimumOctantWidth)Initializes the value for theminimumOctantWidthattribute.OctTreeConfigurationI.BuildersetTrimOnRemove(boolean trimOnRemove)Initializes the value for thetrimOnRemoveattribute.OctTreeConfigurationI.BuildersetVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeI volume)Initializes the value for thevolumeattribute.
-
-
-
Method Detail
-
from
public final OctTreeConfigurationI.Builder from(OctTreeConfigurationIType instance)
Fill a builder with attribute values from the providedOctTreeConfigurationITypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setVolume
public final OctTreeConfigurationI.Builder setVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeI volume)
Initializes the value for thevolumeattribute.- Parameters:
volume- The value for volume- Returns:
thisbuilder for use in a chained invocation
-
setMinimumOctantWidth
public final OctTreeConfigurationI.Builder setMinimumOctantWidth(int minimumOctantWidth)
Initializes the value for theminimumOctantWidthattribute.If not set, this attribute will have a default value as returned by the initializer of
minimumOctantWidth.- Parameters:
minimumOctantWidth- The value for minimumOctantWidth- Returns:
thisbuilder for use in a chained invocation
-
setMinimumOctantHeight
public final OctTreeConfigurationI.Builder setMinimumOctantHeight(int minimumOctantHeight)
Initializes the value for theminimumOctantHeightattribute.If not set, this attribute will have a default value as returned by the initializer of
minimumOctantHeight.- Parameters:
minimumOctantHeight- The value for minimumOctantHeight- Returns:
thisbuilder for use in a chained invocation
-
setMinimumOctantDepth
public final OctTreeConfigurationI.Builder setMinimumOctantDepth(int minimumOctantDepth)
Initializes the value for theminimumOctantDepthattribute.If not set, this attribute will have a default value as returned by the initializer of
minimumOctantDepth.- Parameters:
minimumOctantDepth- The value for minimumOctantDepth- Returns:
thisbuilder for use in a chained invocation
-
setTrimOnRemove
public final OctTreeConfigurationI.Builder setTrimOnRemove(boolean trimOnRemove)
Initializes the value for thetrimOnRemoveattribute.If not set, this attribute will have a default value as returned by the initializer of
trimOnRemove.- Parameters:
trimOnRemove- The value for trimOnRemove- Returns:
thisbuilder for use in a chained invocation
-
build
public OctTreeConfigurationI build()
Builds a newOctTreeConfigurationI.- Returns:
- An immutable instance of OctTreeConfigurationI
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-