Package pl.poznan.put.circular.samples
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 ofTrigonometricMoment.Use the builder to create immutable instances:
ImmutableTrigonometricMoment.builder(). Use the static factory method to create immutable instances:ImmutableTrigonometricMoment.of().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrigonometricMoment.BuilderBuilds instances of typeImmutableTrigonometricMoment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrigonometricMoment.Builderbuilder()Creates a builder forImmutableTrigonometricMoment.static ImmutableTrigonometricMomentcopyOf(TrigonometricMoment instance)Creates an immutable copy of aTrigonometricMomentvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableTrigonometricMomentthat have equal attribute values.inthashCode()Computes a hash code from attributes:meanDirection,meanResultantLength.AnglemeanDirection()doublemeanResultantLength()static ImmutableTrigonometricMomentof(Angle meanDirection, double meanResultantLength)Construct a new immutableTrigonometricMomentinstance.StringtoString()Prints the immutable valueTrigonometricMomentwith attribute values.ImmutableTrigonometricMomentwithMeanDirection(Angle value)Copy the current immutable object by setting a value for themeanDirectionattribute.ImmutableTrigonometricMomentwithMeanResultantLength(double value)Copy the current immutable object by setting a value for themeanResultantLengthattribute.-
Methods inherited from class pl.poznan.put.circular.samples.TrigonometricMoment
computeCentered, computeUncentered
-
-
-
-
Method Detail
-
meanDirection
public Angle meanDirection()
- Specified by:
meanDirectionin classTrigonometricMoment- Returns:
- The mean direction.
-
meanResultantLength
public double meanResultantLength()
- Specified by:
meanResultantLengthin classTrigonometricMoment- 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 themeanDirectionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for meanDirection- Returns:
- A modified copy of the
thisobject
-
withMeanResultantLength
public final ImmutableTrigonometricMoment withMeanResultantLength(double value)
Copy the current immutable object by setting a value for themeanResultantLengthattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for meanResultantLength- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableTrigonometricMomentthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:meanDirection,meanResultantLength.
-
toString
public String toString()
Prints the immutable valueTrigonometricMomentwith attribute values.
-
of
public static ImmutableTrigonometricMoment of(Angle meanDirection, double meanResultantLength)
Construct a new immutableTrigonometricMomentinstance.- Parameters:
meanDirection- The value for themeanDirectionattributemeanResultantLength- The value for themeanResultantLengthattribute- Returns:
- An immutable TrigonometricMoment instance
-
copyOf
public static ImmutableTrigonometricMoment copyOf(TrigonometricMoment instance)
Creates an immutable copy of aTrigonometricMomentvalue. 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 forImmutableTrigonometricMoment.ImmutableTrigonometricMoment.builder() .meanDirection(pl.poznan.put.circular.Angle) // requiredmeanDirection.meanResultantLength(double) // requiredmeanResultantLength.build();- Returns:
- A new ImmutableTrigonometricMoment builder
-
-