Package eu.bandm.tools.d2d2.base
Class Resolver3.Instance
java.lang.Object
eu.bandm.tools.d2d2.base.Resolver3.Instance
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
Resolver3.LocalInstance
- Enclosing class:
- Resolver3
The parametrized instance of one particular d2d model
Definition
.
Goes through several states:
\(creation by resolveAllPublics(..)) \ ownClass [isClass=true,hypo=requires=false,representative=null] ^ | \(creation by newHypthesis(old)) |setIsClass() \ | hypoEquivalent | h=[isClass=requires=falsified=false, hypo=true,representative=old,requiredBy={}] |^ |^ | | ^ || || | | | ||Equivalence.match(h) | |hypothesisFalsified() || with currentHypothesis=x | | |newHypothesis(old) || || | | | || ||Equivalence.match(some hypo) | | || ||with currentHypothesis=h | | | V| || | | | [ ..., requiredBy={x...}] | V | |V | falsified | [ ..., requires=true, ...] | [.., representative=null, falsified=true,..] | hypothesisConfirmed()| V equivWithOther [.. hypothetical=false..]
-
Field Summary
Modifier and TypeFieldDescription(package private) final Set<Resolver3.ImportContext>
Set of other instantiations/rewritings which have been proven to be non-equivalent.(package private) final Resolver3.ImportContext
The fixed import context for which this instance is valid.FIXME RAUS !?!?! A representative which can be re-put intoResolver3.waitingForEquivalence
when the hypotheses fails.(package private) final Set<Resolver3.Instance>
Set of other hypotheses which rely on this one.(package private) final Definition
The rewritten definition, created when constructing this. -
Constructor Summary
ConstructorDescriptionInstance
(Resolver3.ImportContext ic, Definition rewritten, Reference reprRef) -
Method Summary
Modifier and TypeMethodDescriptionformat()
void
The hypothetical equivalence torepresentative
is changed to a confirmed equivalence.void
The hypothetical equivalence torepresentative
has been falsified.boolean
isBound()
Is its own class or hypothetically bound or confirmed bound.boolean
isClass()
newHypothesis
(Resolver3.Instance other) Delivers an instance which is hypothetically equivalent with "other".void
(package private) Definition
Return the rewritten definition, either owned by itself, or by the representative of the equivalence class.
-
Field Details
-
rewritten
The rewritten definition, created when constructing this. -
reprRef
FIXME RAUS !?!?! A representative which can be re-put intoResolver3.waitingForEquivalence
when the hypotheses fails. -
ic
The fixed import context for which this instance is valid. Per raw definition and import context max. one Instance exists. -
requiredBy
Set of other hypotheses which rely on this one. Failure of this hypthesis will be propagated to them. -
different
Set of other instantiations/rewritings which have been proven to be non-equivalent.
-
-
Constructor Details
-
Instance
Instance(Resolver3.ImportContext ic, Definition rewritten, Reference reprRef) Only called byResolver3.createNewInstance(eu.bandm.tools.d2d2.base.Resolver3.ImportContext,eu.bandm.tools.d2d2.model.Definition,@eu.bandm.tools.annotations.Opt eu.bandm.tools.d2d2.model.Reference)
andnewHypothesis(Instance)
. See state machine in the classes doc.
-
-
Method Details
-
setIsClass
public void setIsClass() -
isClass
public boolean isClass() -
isBound
public boolean isBound()Is its own class or hypothetically bound or confirmed bound. "Unbound" only happens after a hypothesis has failed. I -
representative
-
newHypothesis
Delivers an instance which is hypothetically equivalent with "other". Other must be a class on its own (i.e. a representative).
If the current instance depends on other hypotheses (indicated byrequires
==true, technically a new object must be built, because the existing one is in (at least) one set for delivering future fail events. Otherwise the object can be reused.
The returned setting is "this.representative=other; hypothetical=true;falsified=false;" -
hypothesisConfirmed
public void hypothesisConfirmed()The hypothetical equivalence torepresentative
is changed to a confirmed equivalence. -
hypothesisFalsified
public void hypothesisFalsified()The hypothetical equivalence torepresentative
has been falsified. This is reflected by setting that field to ==null. This failure is propagated to all Instances inrequiredBy
. It is memorized indifferent
for quick check of later hypotheses. It is memorized infalsified
only for optimization, to skip propagation in case of multiple calls to this method. -
validDefinition
Definition validDefinition()Return the rewritten definition, either owned by itself, or by the representative of the equivalence class. -
format
-