Class CAxisSystem

java.lang.Object
com.io7m.jcoords.core.conversion.CAxisSystem
All Implemented Interfaces:
CAxisSystemType

public final class CAxisSystem extends Object implements CAxisSystemType
An arrangement of orthonormal axes forming a Cartesian coordinate system.
  • Method Details

    • right

      public CAxis right()
      Specified by:
      right in interface CAxisSystemType
      Returns:
      The axis facing right
    • up

      public CAxis up()
      Specified by:
      up in interface CAxisSystemType
      Returns:
      The axis facing up
    • forward

      public CAxis forward()
      Specified by:
      forward in interface CAxisSystemType
      Returns:
      The axis facing forward
    • withRight

      public final CAxisSystem withRight(CAxis value)
      Copy the current immutable object by setting a value for the right attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for right
      Returns:
      A modified copy of the this object
    • withUp

      public final CAxisSystem withUp(CAxis value)
      Copy the current immutable object by setting a value for the up attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for up
      Returns:
      A modified copy of the this object
    • withForward

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

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

      public int hashCode()
      Computes a hash code from attributes: right, up, forward.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static CAxisSystem of(CAxis right, CAxis up, CAxis forward)
      Construct a new immutable CAxisSystem instance.
      Parameters:
      right - The value for the right attribute
      up - The value for the up attribute
      forward - The value for the forward attribute
      Returns:
      An immutable CAxisSystem instance
    • copyOf

      public static CAxisSystem copyOf(CAxisSystemType instance)
      Creates an immutable copy of a CAxisSystemType 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 CAxisSystem instance
    • builder

      public static CAxisSystem.Builder builder()
      Creates a builder for CAxisSystem.
       CAxisSystem.builder()
          .setRight(com.io7m.jcoords.core.conversion.CAxis) // required right
          .setUp(com.io7m.jcoords.core.conversion.CAxis) // required up
          .setForward(com.io7m.jcoords.core.conversion.CAxis) // required forward
          .build();
       
      Returns:
      A new CAxisSystem builder