Class PropertyCycles
java.lang.Object
org.ek9lang.compiler.support.PropertyCycles
THE reading of phase 5's property-cycle marks (
phase5/PropertyCycleMarker) - use this, never the
squirrelled data directly. Phase 7 synthesis asks it whether a type's GENERATED operators need the runtime cycle
guard (Contract 13) and which fields a generated #? must leave out.
A concrete parameterisation of a developer's generic that phase 5 never saw (phase 7 still makes a few) has no mark at all; it is treated as cyclic, so it is guarded - a guard on an acyclic type costs a little time and is never wrong, a missing one is a StackOverflowError.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCyclic(IAggregateSymbol aggregate) Can an object of this type reach itself through its properties?static booleanleavesOutOfHash(IAggregateSymbol owner, ISymbol field) Must a generated#?on this type leave this field out? True for a field of a cyclic type that can lead back to an object of that type; the hash is then a subset of what==compares, so equal graphs (even co-inductively equal cycles) hash alike, and it never recurses round the loop.
-
Method Details
-
isCyclic
Can an object of this type reach itself through its properties? -
leavesOutOfHash
Must a generated#?on this type leave this field out? True for a field of a cyclic type that can lead back to an object of that type; the hash is then a subset of what==compares, so equal graphs (even co-inductively equal cycles) hash alike, and it never recurses round the loop.- Parameters:
owner- the aggregate the generated operator belongs tofield- one of its fields
-