Package com.io7m.jspatial.api.octtrees
Class OctTreeRaycastResultL<T>
- java.lang.Object
-
- com.io7m.jspatial.api.octtrees.OctTreeRaycastResultL<T>
-
- Type Parameters:
T- The precise type of objects
- All Implemented Interfaces:
OctTreeRaycastResultLType<T>,java.lang.Comparable<OctTreeRaycastResultLType<T>>
public final class OctTreeRaycastResultL<T> extends java.lang.Object implements OctTreeRaycastResultLType<T>
The type of octtree raycast results.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOctTreeRaycastResultL.Builder<T>Builds instances of typeOctTreeRaycastResultL.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> OctTreeRaycastResultL.Builder<T>builder()Creates a builder forOctTreeRaycastResultL.static <T> OctTreeRaycastResultL<T>copyOf(OctTreeRaycastResultLType<T> instance)Creates an immutable copy of aOctTreeRaycastResultLTypevalue.doubledistance()booleanequals(java.lang.Object another)This instance is equal to all instances ofOctTreeRaycastResultLthat have equal attribute values.inthashCode()Computes a hash code from attributes:distance,volume,item.Titem()static <T> OctTreeRaycastResultL<T>of(double distance, com.io7m.jregions.core.unparameterized.volumes.VolumeL volume, T item)Construct a new immutableOctTreeRaycastResultLinstance.java.lang.StringtoString()Prints the immutable valueOctTreeRaycastResultLwith attribute values.com.io7m.jregions.core.unparameterized.volumes.VolumeLvolume()OctTreeRaycastResultL<T>withDistance(double value)Copy the current immutable object by setting a value for thedistanceattribute.OctTreeRaycastResultL<T>withItem(T value)Copy the current immutable object by setting a value for theitemattribute.OctTreeRaycastResultL<T>withVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeL value)Copy the current immutable object by setting a value for thevolumeattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.io7m.jspatial.api.octtrees.OctTreeRaycastResultLType
compareTo
-
-
-
-
Method Detail
-
distance
public double distance()
- Specified by:
distancein interfaceOctTreeRaycastResultLType<T>- Returns:
- The distance to the object
-
volume
public com.io7m.jregions.core.unparameterized.volumes.VolumeL volume()
- Specified by:
volumein interfaceOctTreeRaycastResultLType<T>- Returns:
- The object volume
-
item
public T item()
- Specified by:
itemin interfaceOctTreeRaycastResultLType<T>- Returns:
- The object
-
withDistance
public final OctTreeRaycastResultL<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
-
withVolume
public final OctTreeRaycastResultL<T> withVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeL value)
Copy the current immutable object by setting a value for thevolumeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for volume- Returns:
- A modified copy of the
thisobject
-
withItem
public final OctTreeRaycastResultL<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 ofOctTreeRaycastResultLthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:distance,volume,item.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueOctTreeRaycastResultLwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static <T> OctTreeRaycastResultL<T> of(double distance, com.io7m.jregions.core.unparameterized.volumes.VolumeL volume, T item)
Construct a new immutableOctTreeRaycastResultLinstance.- Parameters:
distance- The value for thedistanceattributevolume- The value for thevolumeattributeitem- The value for theitemattribute- Returns:
- An immutable OctTreeRaycastResultL instance
-
copyOf
public static <T> OctTreeRaycastResultL<T> copyOf(OctTreeRaycastResultLType<T> instance)
Creates an immutable copy of aOctTreeRaycastResultLTypevalue. 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 OctTreeRaycastResultL instance
-
builder
public static <T> OctTreeRaycastResultL.Builder<T> builder()
Creates a builder forOctTreeRaycastResultL.- Type Parameters:
T- generic parameter T- Returns:
- A new OctTreeRaycastResultL builder
-
-