Package com.io7m.jspatial.api.quadtrees
Class QuadTreeRaycastResultL<T>
- java.lang.Object
-
- com.io7m.jspatial.api.quadtrees.QuadTreeRaycastResultL<T>
-
- Type Parameters:
T- The precise type of objects
- All Implemented Interfaces:
QuadTreeRaycastResultLType<T>,java.lang.Comparable<QuadTreeRaycastResultLType<T>>
public final class QuadTreeRaycastResultL<T> extends java.lang.Object implements QuadTreeRaycastResultLType<T>
The type of quadtree raycast results.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuadTreeRaycastResultL.Builder<T>Builds instances of typeQuadTreeRaycastResultL.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.io7m.jregions.core.unparameterized.areas.AreaLarea()static <T> QuadTreeRaycastResultL.Builder<T>builder()Creates a builder forQuadTreeRaycastResultL.static <T> QuadTreeRaycastResultL<T>copyOf(QuadTreeRaycastResultLType<T> instance)Creates an immutable copy of aQuadTreeRaycastResultLTypevalue.doubledistance()booleanequals(java.lang.Object another)This instance is equal to all instances ofQuadTreeRaycastResultLthat have equal attribute values.inthashCode()Computes a hash code from attributes:distance,area,item.Titem()static <T> QuadTreeRaycastResultL<T>of(double distance, com.io7m.jregions.core.unparameterized.areas.AreaL area, T item)Construct a new immutableQuadTreeRaycastResultLinstance.java.lang.StringtoString()Prints the immutable valueQuadTreeRaycastResultLwith attribute values.QuadTreeRaycastResultL<T>withArea(com.io7m.jregions.core.unparameterized.areas.AreaL value)Copy the current immutable object by setting a value for theareaattribute.QuadTreeRaycastResultL<T>withDistance(double value)Copy the current immutable object by setting a value for thedistanceattribute.QuadTreeRaycastResultL<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.QuadTreeRaycastResultLType
compareTo
-
-
-
-
Method Detail
-
distance
public double distance()
- Specified by:
distancein interfaceQuadTreeRaycastResultLType<T>- Returns:
- The distance to the object
-
area
public com.io7m.jregions.core.unparameterized.areas.AreaL area()
- Specified by:
areain interfaceQuadTreeRaycastResultLType<T>- Returns:
- The object area
-
item
public T item()
- Specified by:
itemin interfaceQuadTreeRaycastResultLType<T>- Returns:
- The object
-
withDistance
public final QuadTreeRaycastResultL<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 QuadTreeRaycastResultL<T> withArea(com.io7m.jregions.core.unparameterized.areas.AreaL 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 QuadTreeRaycastResultL<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 ofQuadTreeRaycastResultLthat 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 valueQuadTreeRaycastResultLwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static <T> QuadTreeRaycastResultL<T> of(double distance, com.io7m.jregions.core.unparameterized.areas.AreaL area, T item)
Construct a new immutableQuadTreeRaycastResultLinstance.- Parameters:
distance- The value for thedistanceattributearea- The value for theareaattributeitem- The value for theitemattribute- Returns:
- An immutable QuadTreeRaycastResultL instance
-
copyOf
public static <T> QuadTreeRaycastResultL<T> copyOf(QuadTreeRaycastResultLType<T> instance)
Creates an immutable copy of aQuadTreeRaycastResultLTypevalue. 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 QuadTreeRaycastResultL instance
-
builder
public static <T> QuadTreeRaycastResultL.Builder<T> builder()
Creates a builder forQuadTreeRaycastResultL.- Type Parameters:
T- generic parameter T- Returns:
- A new QuadTreeRaycastResultL builder
-
-