Package com.io7m.jspatial.api.octtrees
Class OctTreeRaycastResultD<T>
- java.lang.Object
-
- com.io7m.jspatial.api.octtrees.OctTreeRaycastResultD<T>
-
- Type Parameters:
T- The precise type of objects
- All Implemented Interfaces:
OctTreeRaycastResultDType<T>,java.lang.Comparable<OctTreeRaycastResultDType<T>>
public final class OctTreeRaycastResultD<T> extends java.lang.Object implements OctTreeRaycastResultDType<T>
The type of octtree raycast results.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOctTreeRaycastResultD.Builder<T>Builds instances of typeOctTreeRaycastResultD.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> OctTreeRaycastResultD.Builder<T>builder()Creates a builder forOctTreeRaycastResultD.static <T> OctTreeRaycastResultD<T>copyOf(OctTreeRaycastResultDType<T> instance)Creates an immutable copy of aOctTreeRaycastResultDTypevalue.doubledistance()booleanequals(java.lang.Object another)This instance is equal to all instances ofOctTreeRaycastResultDthat have equal attribute values.inthashCode()Computes a hash code from attributes:distance,volume,item.Titem()static <T> OctTreeRaycastResultD<T>of(double distance, com.io7m.jregions.core.unparameterized.volumes.VolumeD volume, T item)Construct a new immutableOctTreeRaycastResultDinstance.java.lang.StringtoString()Prints the immutable valueOctTreeRaycastResultDwith attribute values.com.io7m.jregions.core.unparameterized.volumes.VolumeDvolume()OctTreeRaycastResultD<T>withDistance(double value)Copy the current immutable object by setting a value for thedistanceattribute.OctTreeRaycastResultD<T>withItem(T value)Copy the current immutable object by setting a value for theitemattribute.OctTreeRaycastResultD<T>withVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeD 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.OctTreeRaycastResultDType
compareTo
-
-
-
-
Method Detail
-
distance
public double distance()
- Specified by:
distancein interfaceOctTreeRaycastResultDType<T>- Returns:
- The distance to the object
-
volume
public com.io7m.jregions.core.unparameterized.volumes.VolumeD volume()
- Specified by:
volumein interfaceOctTreeRaycastResultDType<T>- Returns:
- The object volume
-
item
public T item()
- Specified by:
itemin interfaceOctTreeRaycastResultDType<T>- Returns:
- The object
-
withDistance
public final OctTreeRaycastResultD<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 OctTreeRaycastResultD<T> withVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeD 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 OctTreeRaycastResultD<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 ofOctTreeRaycastResultDthat 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 valueOctTreeRaycastResultDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static <T> OctTreeRaycastResultD<T> of(double distance, com.io7m.jregions.core.unparameterized.volumes.VolumeD volume, T item)
Construct a new immutableOctTreeRaycastResultDinstance.- Parameters:
distance- The value for thedistanceattributevolume- The value for thevolumeattributeitem- The value for theitemattribute- Returns:
- An immutable OctTreeRaycastResultD instance
-
copyOf
public static <T> OctTreeRaycastResultD<T> copyOf(OctTreeRaycastResultDType<T> instance)
Creates an immutable copy of aOctTreeRaycastResultDTypevalue. 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 OctTreeRaycastResultD instance
-
builder
public static <T> OctTreeRaycastResultD.Builder<T> builder()
Creates a builder forOctTreeRaycastResultD.- Type Parameters:
T- generic parameter T- Returns:
- A new OctTreeRaycastResultD builder
-
-