Class PVector4L<T>
java.lang.Object
com.io7m.jtensors.core.parameterized.vectors.PVector4L<T>
- Type Parameters:
T- A phantom type parameter
- All Implemented Interfaces:
PVector4LType<T>,PVectorReadable2LType<T>,PVectorReadable3LType<T>,PVectorReadable4LType<T>,VectorReadable2LType,VectorReadable3LType,VectorReadable4LType,VectorComputationalType
The type of 4D
long-typed vectors.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> PVector4L.Builder<T> builder()Creates a builder forPVector4L.static <T> PVector4L<T> copyOf(PVector4LType<T> instance) Creates an immutable copy of aPVector4LTypevalue.booleanThis instance is equal to all instances ofPVector4Lthat have equal attribute values.inthashCode()Computes a hash code from attributes:x,y,z,w.static <T> PVector4L<T> of(long x, long y, long z, long w) Construct a new immutablePVector4Linstance.toString()Prints the immutable valuePVector4Lwith attribute values.longw()withW(long value) Copy the current immutable object by setting a value for thewattribute.withX(long value) Copy the current immutable object by setting a value for thexattribute.withY(long value) Copy the current immutable object by setting a value for theyattribute.withZ(long value) Copy the current immutable object by setting a value for thezattribute.longx()longy()longz()
-
Method Details
-
x
public long x()- Specified by:
xin interfacePVector4LType<T>- Specified by:
xin interfaceVectorReadable2LType- Returns:
- The value of the
xattribute
-
y
public long y()- Specified by:
yin interfacePVector4LType<T>- Specified by:
yin interfaceVectorReadable2LType- Returns:
- The value of the
yattribute
-
z
public long z()- Specified by:
zin interfacePVector4LType<T>- Specified by:
zin interfaceVectorReadable3LType- Returns:
- The value of the
zattribute
-
w
public long w()- Specified by:
win interfacePVector4LType<T>- Specified by:
win interfaceVectorReadable4LType- Returns:
- The value of the
wattribute
-
withX
Copy the current immutable object by setting a value for thexattribute. A value equality check is 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 equality check is 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 equality check is 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 equality check is 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 ofPVector4Lthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:x,y,z,w. -
toString
Prints the immutable valuePVector4Lwith attribute values. -
of
Construct a new immutablePVector4Linstance.- 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 PVector4L instance
-
copyOf
Creates an immutable copy of aPVector4LTypevalue. 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 PVector4L instance
-
builder
Creates a builder forPVector4L.PVector4L.<T>builder() .setX(long) // requiredx.setY(long) // requiredy.setZ(long) // requiredz.setW(long) // requiredw.build();- Type Parameters:
T- generic parameter T- Returns:
- A new PVector4L builder
-