Class HasOwnComparator
java.lang.Object
org.ek9lang.compiler.support.sameness.HasOwnComparator
- All Implemented Interfaces:
BiPredicate<IAggregateSymbol, ISymbol>
public final class HasOwnComparator
extends Object
implements BiPredicate<IAggregateSymbol, ISymbol>
THE "has the aggregate its own REAL
<=> that takes itself" - hand-written, or defaulted (and not retracted)
over fields that can all really be ordered. Then every defaulted comparison, == and <> included, is
answered by it (Steve, 2026-09-29; DefaultedComparisonDelegate), so a defaulted
operator can never disagree with the type's ordering. Without one, == is field by field and <> its
negation.
🔑 A defaulted <=> over a field that cannot be ordered degenerates to Any's, which is UNSET: a
generic Box of List derived an UNSET == from it while field by field is true (Fable review p05d).
So such an instantiation falls back to field-wise == - B07's rule applied per instantiation (B18 rule 8).
Hold one and ask it with the Any type.
-
Constructor Summary
ConstructorsConstructorDescriptionA comparator test over its ownOrderingAvailability.HasOwnComparator(OrderingAvailability orderingAvailability) A comparator test over the givenOrderingAvailability- the one that holds it (each asks the other). -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiPredicate
and, negate, or
-
Constructor Details
-
HasOwnComparator
public HasOwnComparator()A comparator test over its ownOrderingAvailability. -
HasOwnComparator
HasOwnComparator(OrderingAvailability orderingAvailability) A comparator test over the givenOrderingAvailability- the one that holds it (each asks the other).
-
-
Method Details
-
test
- Specified by:
testin interfaceBiPredicate<IAggregateSymbol, ISymbol>
-