Package com.io7m.jspatial.api.quadtrees
Class QuadTreeRaycastResultD<T>
- java.lang.Object
-
- com.io7m.jspatial.api.quadtrees.QuadTreeRaycastResultD<T>
-
- Type Parameters:
T- The precise type of objects
- All Implemented Interfaces:
QuadTreeRaycastResultDType<T>,java.lang.Comparable<QuadTreeRaycastResultDType<T>>
public final class QuadTreeRaycastResultD<T> extends java.lang.Object implements QuadTreeRaycastResultDType<T>
The type of quadtree raycast results.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuadTreeRaycastResultD.Builder<T>Builds instances of typeQuadTreeRaycastResultD.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.io7m.jregions.core.unparameterized.areas.AreaDarea()static <T> QuadTreeRaycastResultD.Builder<T>builder()Creates a builder forQuadTreeRaycastResultD.static <T> QuadTreeRaycastResultD<T>copyOf(QuadTreeRaycastResultDType<T> instance)Creates an immutable copy of aQuadTreeRaycastResultDTypevalue.doubledistance()booleanequals(java.lang.Object another)This instance is equal to all instances ofQuadTreeRaycastResultDthat have equal attribute values.inthashCode()Computes a hash code from attributes:distance,area,item.Titem()static <T> QuadTreeRaycastResultD<T>of(double distance, com.io7m.jregions.core.unparameterized.areas.AreaD area, T item)Construct a new immutableQuadTreeRaycastResultDinstance.java.lang.StringtoString()Prints the immutable valueQuadTreeRaycastResultDwith attribute values.QuadTreeRaycastResultD<T>withArea(com.io7m.jregions.core.unparameterized.areas.AreaD value)Copy the current immutable object by setting a value for theareaattribute.QuadTreeRaycastResultD<T>withDistance(double value)Copy the current immutable object by setting a value for thedistanceattribute.QuadTreeRaycastResultD<T>withItem(T value)Copy the current immutable object by setting a value for theitemattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.io7m.jspatial.api.quadtrees.QuadTreeRaycastResultDType
compareTo
-
-
-
-
Method Detail
-
distance
public double distance()
- Specified by:
distancein interfaceQuadTreeRaycastResultDType<T>- Returns:
- The distance to the object
-
area
public com.io7m.jregions.core.unparameterized.areas.AreaD area()
- Specified by:
areain interfaceQuadTreeRaycastResultDType<T>- Returns:
- The object area
-
item
public T item()
- Specified by:
itemin interfaceQuadTreeRaycastResultDType<T>- Returns:
- The object
-
withDistance
public final QuadTreeRaycastResultD<T> withDistance(double value)
Copy the current immutable object by setting a value for thedistanceattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for distance- Returns:
- A modified copy of the
thisobject
-
withArea
public final QuadTreeRaycastResultD<T> withArea(com.io7m.jregions.core.unparameterized.areas.AreaD 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
-
withItem
public final QuadTreeRaycastResultD<T> withItem(T value)
Copy the current immutable object by setting a value for theitemattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for item- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofQuadTreeRaycastResultDthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:distance,area,item.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueQuadTreeRaycastResultDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static <T> QuadTreeRaycastResultD<T> of(double distance, com.io7m.jregions.core.unparameterized.areas.AreaD area, T item)
Construct a new immutableQuadTreeRaycastResultDinstance.- Parameters:
distance- The value for thedistanceattributearea- The value for theareaattributeitem- The value for theitemattribute- Returns:
- An immutable QuadTreeRaycastResultD instance
-
copyOf
public static <T> QuadTreeRaycastResultD<T> copyOf(QuadTreeRaycastResultDType<T> instance)
Creates an immutable copy of aQuadTreeRaycastResultDTypevalue. 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 QuadTreeRaycastResultD instance
-
builder
public static <T> QuadTreeRaycastResultD.Builder<T> builder()
Creates a builder forQuadTreeRaycastResultD.- Type Parameters:
T- generic parameter T- Returns:
- A new QuadTreeRaycastResultD builder
-
-