Class QuadTreeRaycastResultI<T>

    • Method Detail

      • area

        public com.io7m.jregions.core.unparameterized.areas.AreaI area()
        Specified by:
        area in interface QuadTreeRaycastResultIType<T>
        Returns:
        The object area
      • withDistance

        public final QuadTreeRaycastResultI<T> withDistance​(double value)
        Copy the current immutable object by setting a value for the distance attribute. A value strict bits equality used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for distance
        Returns:
        A modified copy of the this object
      • withArea

        public final QuadTreeRaycastResultI<T> 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
      • withItem

        public final QuadTreeRaycastResultI<T> withItem​(T value)
        Copy the current immutable object by setting a value for the item attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for item
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(java.lang.Object another)
        This instance is equal to all instances of QuadTreeRaycastResultI 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: distance, area, item.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value QuadTreeRaycastResultI with attribute values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the value
      • of

        public static <T> QuadTreeRaycastResultI<T> of​(double distance,
                                                       com.io7m.jregions.core.unparameterized.areas.AreaI area,
                                                       T item)
        Construct a new immutable QuadTreeRaycastResultI instance.
        Parameters:
        distance - The value for the distance attribute
        area - The value for the area attribute
        item - The value for the item attribute
        Returns:
        An immutable QuadTreeRaycastResultI instance
      • copyOf

        public static <T> QuadTreeRaycastResultI<T> copyOf​(QuadTreeRaycastResultIType<T> instance)
        Creates an immutable copy of a QuadTreeRaycastResultIType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Type Parameters:
        T - generic parameter T
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable QuadTreeRaycastResultI instance