Class ImmutableTrigonometricMoment

java.lang.Object
pl.poznan.put.circular.samples.TrigonometricMoment
pl.poznan.put.circular.samples.ImmutableTrigonometricMoment

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableTrigonometricMoment extends TrigonometricMoment
Immutable implementation of TrigonometricMoment.

Use the builder to create immutable instances: ImmutableTrigonometricMoment.builder(). Use the static factory method to create immutable instances: ImmutableTrigonometricMoment.of().

  • Method Details

    • meanDirection

      public Angle meanDirection()
      Specified by:
      meanDirection in class TrigonometricMoment
      Returns:
      The mean direction.
    • meanResultantLength

      public double meanResultantLength()
      Specified by:
      meanResultantLength in class TrigonometricMoment
      Returns:
      The length of the vector representing the mean direction.
    • withMeanDirection

      public final ImmutableTrigonometricMoment withMeanDirection(Angle value)
      Copy the current immutable object by setting a value for the meanDirection attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for meanDirection
      Returns:
      A modified copy of the this object
    • withMeanResultantLength

      public final ImmutableTrigonometricMoment withMeanResultantLength(double value)
      Copy the current immutable object by setting a value for the meanResultantLength attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for meanResultantLength
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTrigonometricMoment 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: meanDirection, meanResultantLength.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableTrigonometricMoment of(Angle meanDirection, double meanResultantLength)
      Construct a new immutable TrigonometricMoment instance.
      Parameters:
      meanDirection - The value for the meanDirection attribute
      meanResultantLength - The value for the meanResultantLength attribute
      Returns:
      An immutable TrigonometricMoment instance
    • copyOf

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

      public static ImmutableTrigonometricMoment.Builder builder()
      Creates a builder for ImmutableTrigonometricMoment.
       ImmutableTrigonometricMoment.builder()
          .meanDirection(pl.poznan.put.circular.Angle) // required meanDirection
          .meanResultantLength(double) // required meanResultantLength
          .build();
       
      Returns:
      A new ImmutableTrigonometricMoment builder