Record Class LeafPath
java.lang.Object
java.lang.Record
org.ek9lang.compiler.support.inputvariety.LeafPath
- Record Components:
fields- the field steps from the declared parameter to this leaf; empty when the parameter is itself the leaf (a scalar, an enum, or an opaque non-record aggregate)leafType- the resolved type of the leaf value itself — the type whose class model applies
One scalar leaf dimension of a callable's input space, together with the field path walked to
reach it from the declared parameter (design EK9_INPUT_VARIATION_METRIC_DESIGN.md §4.5/§4.6).
This is what lets the numerator and the denominator stay in lock-step. Both come from the single
traversal in EquivalenceClassModel.leafPathsOf(ISymbol): the denominator projects each leaf
to its TypeVariety (how many classes this leaf could show), while the numerator projects the
same leaf to a field access the backend emits (which class the leaf actually showed). Were the two
to walk a record's fields separately they could disagree on order, depth or width bounds — and a
numerator counting different leaves than the floor makes 100% unreachable or spuriously reachable.
One traversal, two projections, so that drift cannot happen.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdepth()The record-nesting depth of this leaf: one field step per record hop (see §4.5 MAX_DEPTH).final booleanIndicates whether some other object is "equal to" this one.fields()Returns the value of thefieldsrecord component.final inthashCode()Returns a hash code value for this object.booleanisDirect()True when the declared parameter IS the leaf — no record decomposition was applied.leafType()Returns the value of theleafTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LeafPath
-
-
Method Details
-
depth
public int depth()The record-nesting depth of this leaf: one field step per record hop (see §4.5 MAX_DEPTH). -
isDirect
public boolean isDirect()True when the declared parameter IS the leaf — no record decomposition was applied. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
fields
-
leafType
-