Class Vector4D
java.lang.Object
com.io7m.jtensors.core.unparameterized.vectors.Vector4D
- All Implemented Interfaces:
Vector4DType, VectorReadable2DType, VectorReadable3DType, VectorReadable4DType, VectorComputationalType
The type of 4D
double-typed vectors.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Vector4D.Builderbuilder()Creates a builder forVector4D.static Vector4DcopyOf(Vector4DType instance) Creates an immutable copy of aVector4DTypevalue.booleanThis instance is equal to all instances ofVector4Dthat have equal attribute values.inthashCode()Computes a hash code from attributes:x,y,z,w.static Vector4Dof(double x, double y, double z, double w) Construct a new immutableVector4Dinstance.toString()Prints the immutable valueVector4Dwith attribute values.doublew()final Vector4DwithW(double value) Copy the current immutable object by setting a value for thewattribute.final Vector4DwithX(double value) Copy the current immutable object by setting a value for thexattribute.final Vector4DwithY(double value) Copy the current immutable object by setting a value for theyattribute.final Vector4DwithZ(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 interfaceVector4DType- Specified by:
xin interfaceVectorReadable2DType- Returns:
- The value of the
xattribute
-
y
public double y()- Specified by:
yin interfaceVector4DType- Specified by:
yin interfaceVectorReadable2DType- Returns:
- The value of the
yattribute
-
z
public double z()- Specified by:
zin interfaceVector4DType- Specified by:
zin interfaceVectorReadable3DType- Returns:
- The value of the
zattribute
-
w
public double w()- Specified by:
win interfaceVector4DType- Specified by:
win interfaceVectorReadable4DType- Returns:
- The value of the
wattribute
-
withX
-
withY
-
withZ
-
withW
-
equals
-
hashCode
-
toString
-
of
Construct a new immutableVector4Dinstance.- Parameters:
x- The value for thexattributey- The value for theyattributez- The value for thezattributew- The value for thewattribute- Returns:
- An immutable Vector4D instance
-
copyOf
Creates an immutable copy of aVector4DTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Vector4D instance
-
builder
-