Class PMatrix2x2D<A,​B>

java.lang.Object
com.io7m.jtensors.core.parameterized.matrices.PMatrix2x2D<A,​B>
Type Parameters:
A - A phantom type parameter (possibly representing a source coordinate system)
B - A phantom type parameter (possibly representing a target coordinate system)
All Implemented Interfaces:
MatrixComputationalType, PMatrix2x2DType<A,​B>, PMatrixReadable2x2DType<A,​B>, MatrixReadable2x2DType, MatrixReadableDType

public final class PMatrix2x2D<A,​B>
extends java.lang.Object
implements PMatrix2x2DType<A,​B>
The type of 2x2 double-typed matrices.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  PMatrix2x2D.Builder<A,​B>
    Builds instances of type PMatrix2x2D.
  • Method Summary

    Modifier and Type Method Description
    static <A,​ B> PMatrix2x2D.Builder<A,​B> builder()
    Creates a builder for PMatrix2x2D.
    static <A,​ B> PMatrix2x2D<A,​B> copyOf​(PMatrix2x2DType<A,​B> instance)
    Creates an immutable copy of a PMatrix2x2DType value.
    boolean equals​(java.lang.Object another)
    This instance is equal to all instances of PMatrix2x2D that have equal attribute values.
    int hashCode()
    Computes a hash code from attributes: r0c0, r0c1, r1c0, r1c1.
    static <A,​ B> PMatrix2x2D<A,​B> of​(double r0c0, double r0c1, double r1c0, double r1c1)
    Construct a new immutable PMatrix2x2D instance.
    double r0c0()  
    double r0c1()  
    double r1c0()  
    double r1c1()  
    java.lang.String toString()
    Prints the immutable value PMatrix2x2D with attribute values.
    PMatrix2x2D<A,​B> withR0c0​(double value)
    Copy the current immutable object by setting a value for the r0c0 attribute.
    PMatrix2x2D<A,​B> withR0c1​(double value)
    Copy the current immutable object by setting a value for the r0c1 attribute.
    PMatrix2x2D<A,​B> withR1c0​(double value)
    Copy the current immutable object by setting a value for the r1c0 attribute.
    PMatrix2x2D<A,​B> withR1c1​(double value)
    Copy the current immutable object by setting a value for the r1c1 attribute.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.io7m.jtensors.core.unparameterized.matrices.MatrixReadable2x2DType

    rowColumn
  • Method Details

    • r0c0

      public double r0c0()
      Specified by:
      r0c0 in interface MatrixReadable2x2DType
      Specified by:
      r0c0 in interface PMatrix2x2DType<A,​B>
      Returns:
      The value at row 0 column 0
    • r0c1

      public double r0c1()
      Specified by:
      r0c1 in interface MatrixReadable2x2DType
      Specified by:
      r0c1 in interface PMatrix2x2DType<A,​B>
      Returns:
      The value at row 0 column 1
    • r1c0

      public double r1c0()
      Specified by:
      r1c0 in interface MatrixReadable2x2DType
      Specified by:
      r1c0 in interface PMatrix2x2DType<A,​B>
      Returns:
      The value at row 1 column 0
    • r1c1

      public double r1c1()
      Specified by:
      r1c1 in interface MatrixReadable2x2DType
      Specified by:
      r1c1 in interface PMatrix2x2DType<A,​B>
      Returns:
      The value at row 1 column 1
    • withR0c0

      public final PMatrix2x2D<A,​B> withR0c0​(double value)
      Copy the current immutable object by setting a value for the r0c0 attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for r0c0
      Returns:
      A modified copy of the this object
    • withR0c1

      public final PMatrix2x2D<A,​B> withR0c1​(double value)
      Copy the current immutable object by setting a value for the r0c1 attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for r0c1
      Returns:
      A modified copy of the this object
    • withR1c0

      public final PMatrix2x2D<A,​B> withR1c0​(double value)
      Copy the current immutable object by setting a value for the r1c0 attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for r1c0
      Returns:
      A modified copy of the this object
    • withR1c1

      public final PMatrix2x2D<A,​B> withR1c1​(double value)
      Copy the current immutable object by setting a value for the r1c1 attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for r1c1
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of PMatrix2x2D 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: r0c0, r0c1, r1c0, r1c1.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

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

      public static <A,​ B> PMatrix2x2D<A,​B> of​(double r0c0, double r0c1, double r1c0, double r1c1)
      Construct a new immutable PMatrix2x2D instance.
      Type Parameters:
      A - generic parameter A
      B - generic parameter B
      Parameters:
      r0c0 - The value for the r0c0 attribute
      r0c1 - The value for the r0c1 attribute
      r1c0 - The value for the r1c0 attribute
      r1c1 - The value for the r1c1 attribute
      Returns:
      An immutable PMatrix2x2D instance
    • copyOf

      public static <A,​ B> PMatrix2x2D<A,​B> copyOf​(PMatrix2x2DType<A,​B> instance)
      Creates an immutable copy of a PMatrix2x2DType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      A - generic parameter A
      B - generic parameter B
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable PMatrix2x2D instance
    • builder

      public static <A,​ B> PMatrix2x2D.Builder<A,​B> builder()
      Creates a builder for PMatrix2x2D.
       PMatrix2x2D.&lt;A, B&gt;builder()
          .setR0c0(double) // required r0c0
          .setR0c1(double) // required r0c1
          .setR1c0(double) // required r1c0
          .setR1c1(double) // required r1c1
          .build();
       
      Type Parameters:
      A - generic parameter A
      B - generic parameter B
      Returns:
      A new PMatrix2x2D builder