Class QuadTreeConfigurationI

    • Method Detail

      • area

        public com.io7m.jregions.core.unparameterized.areas.AreaI area()
        Specified by:
        area in interface QuadTreeConfigurationIType
        Returns:
        The maximum bounding area of the tree
      • trimOnRemove

        public boolean trimOnRemove()
        Specified by:
        trimOnRemove in interface QuadTreeConfigurationIType
        Returns:
        true iff 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 the area attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for area
        Returns:
        A modified copy of the this object
      • withMinimumQuadrantWidth

        public final QuadTreeConfigurationI withMinimumQuadrantWidth​(int value)
        Copy the current immutable object by setting a value for the minimumQuadrantWidth attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for minimumQuadrantWidth
        Returns:
        A modified copy of the this object
      • withMinimumQuadrantHeight

        public final QuadTreeConfigurationI withMinimumQuadrantHeight​(int value)
        Copy the current immutable object by setting a value for the minimumQuadrantHeight attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for minimumQuadrantHeight
        Returns:
        A modified copy of the this object
      • withTrimOnRemove

        public final QuadTreeConfigurationI withTrimOnRemove​(boolean value)
        Copy the current immutable object by setting a value for the trimOnRemove attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for trimOnRemove
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(java.lang.Object another)
        This instance is equal to all instances of QuadTreeConfigurationI that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: area, minimumQuadrantWidth, minimumQuadrantHeight, trimOnRemove.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value QuadTreeConfigurationI with attribute values.
        Overrides:
        toString in class java.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 immutable QuadTreeConfigurationI instance.
        Parameters:
        area - The value for the area attribute
        minimumQuadrantWidth - The value for the minimumQuadrantWidth attribute
        minimumQuadrantHeight - The value for the minimumQuadrantHeight attribute
        trimOnRemove - The value for the trimOnRemove attribute
        Returns:
        An immutable QuadTreeConfigurationI instance
      • copyOf

        public static QuadTreeConfigurationI copyOf​(QuadTreeConfigurationIType instance)
        Creates an immutable copy of a QuadTreeConfigurationIType value. 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