java.lang.Object
com.io7m.jtensors.core.unparameterized.vectors.Vector4L
All Implemented Interfaces:
Vector4LType, VectorReadable2LType, VectorReadable3LType, VectorReadable4LType, VectorComputationalType

public final class Vector4L
extends java.lang.Object
implements Vector4LType
The type of 4D long-typed vectors.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  Vector4L.Builder
    Builds instances of type Vector4L.
  • Method Summary

    Modifier and Type Method Description
    static Vector4L.Builder builder()
    Creates a builder for Vector4L.
    static Vector4L copyOf​(Vector4LType instance)
    Creates an immutable copy of a Vector4LType value.
    boolean equals​(java.lang.Object another)
    This instance is equal to all instances of Vector4L that have equal attribute values.
    int hashCode()
    Computes a hash code from attributes: x, y, z, w.
    static Vector4L of​(long x, long y, long z, long w)
    Construct a new immutable Vector4L instance.
    java.lang.String toString()
    Prints the immutable value Vector4L with attribute values.
    long w()  
    Vector4L withW​(long value)
    Copy the current immutable object by setting a value for the w attribute.
    Vector4L withX​(long value)
    Copy the current immutable object by setting a value for the x attribute.
    Vector4L withY​(long value)
    Copy the current immutable object by setting a value for the y attribute.
    Vector4L withZ​(long value)
    Copy the current immutable object by setting a value for the z attribute.
    long x()  
    long y()  
    long z()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • x

      public long x()
      Specified by:
      x in interface Vector4LType
      Specified by:
      x in interface VectorReadable2LType
      Returns:
      The value of the x attribute
    • y

      public long y()
      Specified by:
      y in interface Vector4LType
      Specified by:
      y in interface VectorReadable2LType
      Returns:
      The value of the y attribute
    • z

      public long z()
      Specified by:
      z in interface Vector4LType
      Specified by:
      z in interface VectorReadable3LType
      Returns:
      The value of the z attribute
    • w

      public long w()
      Specified by:
      w in interface Vector4LType
      Specified by:
      w in interface VectorReadable4LType
      Returns:
      The value of the w attribute
    • withX

      public final Vector4L withX​(long value)
      Copy the current immutable object by setting a value for the x attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for x
      Returns:
      A modified copy of the this object
    • withY

      public final Vector4L withY​(long value)
      Copy the current immutable object by setting a value for the y attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for y
      Returns:
      A modified copy of the this object
    • withZ

      public final Vector4L withZ​(long value)
      Copy the current immutable object by setting a value for the z attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for z
      Returns:
      A modified copy of the this object
    • withW

      public final Vector4L withW​(long value)
      Copy the current immutable object by setting a value for the w attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for w
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of Vector4L that have equal attribute values.
      Overrides:
      equals in class java.lang.Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: x, y, z, w.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

      public java.lang.String toString()
      Prints the immutable value Vector4L with attribute values.
      Overrides:
      toString in class java.lang.Object
      Returns:
      A string representation of the value
    • of

      public static Vector4L of​(long x, long y, long z, long w)
      Construct a new immutable Vector4L instance.
      Parameters:
      x - The value for the x attribute
      y - The value for the y attribute
      z - The value for the z attribute
      w - The value for the w attribute
      Returns:
      An immutable Vector4L instance
    • copyOf

      public static Vector4L copyOf​(Vector4LType instance)
      Creates an immutable copy of a Vector4LType value. 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 Vector4L instance
    • builder

      public static Vector4L.Builder builder()
      Creates a builder for Vector4L.
       Vector4L.builder()
          .setX(long) // required x
          .setY(long) // required y
          .setZ(long) // required z
          .setW(long) // required w
          .build();
       
      Returns:
      A new Vector4L builder