Class PVector4D<T>
java.lang.Object
com.io7m.jtensors.core.parameterized.vectors.PVector4D<T>
- Type Parameters:
T- A phantom type parameter
- All Implemented Interfaces:
PVector4DType<T>,PVectorReadable2DType<T>,PVectorReadable3DType<T>,PVectorReadable4DType<T>,VectorReadable2DType,VectorReadable3DType,VectorReadable4DType,VectorComputationalType
The type of 4D
double-typed vectors.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> PVector4D.Builder<T> builder()Creates a builder forPVector4D.static <T> PVector4D<T> copyOf(PVector4DType<T> instance) Creates an immutable copy of aPVector4DTypevalue.booleanThis instance is equal to all instances ofPVector4Dthat have equal attribute values.inthashCode()Computes a hash code from attributes:x,y,z,w.static <T> PVector4D<T> of(double x, double y, double z, double w) Construct a new immutablePVector4Dinstance.toString()Prints the immutable valuePVector4Dwith attribute values.doublew()withW(double value) Copy the current immutable object by setting a value for thewattribute.withX(double value) Copy the current immutable object by setting a value for thexattribute.withY(double value) Copy the current immutable object by setting a value for theyattribute.withZ(double value) Copy the current immutable object by setting a value for thezattribute.doublex()doubley()doublez()
-
Method Details
-
x
public double x()- Specified by:
xin interfacePVector4DType<T>- Specified by:
xin interfaceVectorReadable2DType- Returns:
- The value of the
xattribute
-
y
public double y()- Specified by:
yin interfacePVector4DType<T>- Specified by:
yin interfaceVectorReadable2DType- Returns:
- The value of the
yattribute
-
z
public double z()- Specified by:
zin interfacePVector4DType<T>- Specified by:
zin interfaceVectorReadable3DType- Returns:
- The value of the
zattribute
-
w
public double w()- Specified by:
win interfacePVector4DType<T>- Specified by:
win interfaceVectorReadable4DType- Returns:
- The value of the
wattribute
-
withX
Copy the current immutable object by setting a value for thexattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for x- Returns:
- A modified copy of the
thisobject
-
withY
Copy the current immutable object by setting a value for theyattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for y- Returns:
- A modified copy of the
thisobject
-
withZ
Copy the current immutable object by setting a value for thezattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for z- Returns:
- A modified copy of the
thisobject
-
withW
Copy the current immutable object by setting a value for thewattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for w- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofPVector4Dthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:x,y,z,w. -
toString
Prints the immutable valuePVector4Dwith attribute values. -
of
Construct a new immutablePVector4Dinstance.- Type Parameters:
T- generic parameter T- Parameters:
x- The value for thexattributey- The value for theyattributez- The value for thezattributew- The value for thewattribute- Returns:
- An immutable PVector4D instance
-
copyOf
Creates an immutable copy of aPVector4DTypevalue. 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 PVector4D instance
-
builder
Creates a builder forPVector4D.PVector4D.<T>builder() .setX(double) // requiredx.setY(double) // requiredy.setZ(double) // requiredz.setW(double) // requiredw.build();- Type Parameters:
T- generic parameter T- Returns:
- A new PVector4D builder
-