ImmutableTriangle
public final class ImmutableTriangle extends Triangle
An immutable triangle, defined by its three corners p0, p1 and p2 in order. This object is immutable, so it is inherently thread-safe. See MutableTriangle for the mutable version.
Summary
Public methods |
|
|---|---|
boolean |
Equality for |
@NonNull ImmutableVec |
getP0()One of the three points that define the |
@NonNull ImmutableVec |
getP1()One of the three points that define the |
@NonNull ImmutableVec |
getP2()One of the three points that define the |
int |
hashCode() |
@NonNull ImmutableTriangle |
Returns an immutable copy of this object. |
@NonNull String |
toString() |
Inherited methods |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Public methods
equals
public boolean equals(Object other)
Equality for ImmutableTriangle is defined using the order in which p0, p1 and p2 are defined. Rotated/flipped triangles with out-of-order vertices are not considered equal.
toImmutable
public @NonNull ImmutableTriangle toImmutable()
Returns an immutable copy of this object. This will return itself if called on an immutable instance.