Class ScopeFmi2Api
- java.lang.Object
-
- org.intocps.maestro.framework.fmi2.api.mabl.scoping.ScopeFmi2Api
-
- All Implemented Interfaces:
org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>,org.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm>,org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>,org.intocps.maestro.framework.fmi2.api.Fmi2Builder.WhileScope<org.intocps.maestro.ast.node.PStm>,IMablScope
- Direct Known Subclasses:
WhileMaBLScope
public class ScopeFmi2Api extends java.lang.Object implements IMablScope, org.intocps.maestro.framework.fmi2.api.Fmi2Builder.WhileScope<org.intocps.maestro.ast.node.PStm>
-
-
Constructor Summary
Constructors Constructor Description ScopeFmi2Api(MablApiBuilder builder)ScopeFmi2Api(MablApiBuilder builder, org.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm> parent, org.intocps.maestro.ast.node.SBlockStm block)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScopeFmi2Apiactivate()voidadd(org.intocps.maestro.ast.node.PStm... commands)voidaddAfter(org.intocps.maestro.ast.node.PStm item, org.intocps.maestro.ast.node.PStm... commands)voidaddAfterOrTop(org.intocps.maestro.ast.node.PStm item, org.intocps.maestro.ast.node.PStm... commands)Attempts to finditemand placescommandsafter it.voidaddAll(java.util.Collection<org.intocps.maestro.ast.node.PStm> commands)voidaddBefore(org.intocps.maestro.ast.node.PStm item, org.intocps.maestro.ast.node.PStm... commands)<Var extends VariableFmi2Api>
Varcopy(java.lang.String name, Var variable)FmuVariableFmi2ApicreateFMU(java.lang.String name, java.lang.String loaderName, java.lang.String... args)FmuVariableFmi2ApicreateFMU(java.lang.String name, org.intocps.maestro.fmi.Fmi2ModelDescription modelDescription, java.net.URI path)IfMaBlScopeenterIf(org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Predicate predicate)IMablScopeenterScope()TryMaBlScopeenterTry()WhileMaBLScopeenterWhile(org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Predicate predicate)<P extends org.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm>>
PfindParent(java.lang.Class<P> clz)<S> SfindParentScope(java.lang.Class<S> type)java.util.Set<ComponentVariableFmi2Api>getAllComponentFmi2Variables()Retrieves a set of allComponentFmi2Variables including those of parentsorg.intocps.maestro.ast.node.SBlockStmgetBlock()org.intocps.maestro.ast.node.PStmgetDeclaration()IntVariableFmi2ApigetFmiStatusVariable()java.lang.StringgetName(java.lang.String prefix)intindexOf(org.intocps.maestro.ast.node.PStm stm)ScopeFmi2Apileave()IMablScopeparallel()org.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm>parent()voidregisterComponentVariableFmi2Api(ComponentVariableFmi2Api componentVariableFmi2Api)This is used to maintain a register of stored ComponentVariableFmi2API, such that they can be freed in case of an error.BooleanVariableFmi2Apistore(boolean value)DoubleVariableFmi2Apistore(double value)IntVariableFmi2Apistore(int value)StringVariableFmi2Apistore(java.lang.String value)BooleanVariableFmi2Apistore(java.lang.String name, boolean value)DoubleVariableFmi2Apistore(java.lang.String prefix, double value)IntVariableFmi2Apistore(java.lang.String name, int value)StringVariableFmi2Apistore(java.lang.String prefix, java.lang.String value)DoubleVariableFmi2Apistore(java.lang.String namePrefix, DoubleVariableFmi2Api variable)IntVariableFmi2Apistore(java.lang.String namePrefix, IntVariableFmi2Api variable)<V> ArrayVariableFmi2Api<V>store(java.lang.String name, V[] value)BooleanVariableFmi2Apistore(java.util.function.Supplier<java.lang.String> nameProvider, boolean value)DoubleVariableFmi2Apistore(java.util.function.Supplier<java.lang.String> nameProvider, double value)IntVariableFmi2Apistore(java.util.function.Supplier<java.lang.String> nameProvider, int value)StringVariableFmi2Apistore(java.util.function.Supplier<java.lang.String> nameProvider, java.lang.String value)protected <V> ArrayVariableFmi2Api<V>store(java.util.function.Supplier<java.lang.String> nameProvider, V[] value)<V> org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Variable<org.intocps.maestro.ast.node.PStm,V>store(org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Value<V> tag)ArrayVariableFmi2ApistoreInArray(java.lang.String namePrefix, VariableFmi2Api[] variables)
-
-
-
Constructor Detail
-
ScopeFmi2Api
public ScopeFmi2Api(MablApiBuilder builder)
-
ScopeFmi2Api
public ScopeFmi2Api(MablApiBuilder builder, org.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm> parent, org.intocps.maestro.ast.node.SBlockStm block)
-
-
Method Detail
-
getBlock
public org.intocps.maestro.ast.node.SBlockStm getBlock()
-
enterWhile
public WhileMaBLScope enterWhile(org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Predicate predicate)
- Specified by:
enterWhilein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
enterWhilein interfaceIMablScope
-
enterTry
public TryMaBlScope enterTry()
- Specified by:
enterTryin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
enterTryin interfaceIMablScope
-
enterIf
public IfMaBlScope enterIf(org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Predicate predicate)
- Specified by:
enterIfin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
enterIfin interfaceIMablScope
-
parallel
public IMablScope parallel()
- Specified by:
parallelin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
parallelin interfaceIMablScope
-
leave
public ScopeFmi2Api leave()
- Specified by:
leavein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
leavein interfaceIMablScope
-
add
public void add(org.intocps.maestro.ast.node.PStm... commands)
- Specified by:
addin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
addin interfaceIMablScope
-
addAll
public void addAll(java.util.Collection<org.intocps.maestro.ast.node.PStm> commands)
- Specified by:
addAllin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
addAllin interfaceIMablScope
-
addBefore
public void addBefore(org.intocps.maestro.ast.node.PStm item, org.intocps.maestro.ast.node.PStm... commands)- Specified by:
addBeforein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
addBeforein interfaceIMablScope
-
addAfter
public void addAfter(org.intocps.maestro.ast.node.PStm item, org.intocps.maestro.ast.node.PStm... commands)- Specified by:
addAfterin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
addAfterin interfaceIMablScope
-
addAfterOrTop
public void addAfterOrTop(org.intocps.maestro.ast.node.PStm item, org.intocps.maestro.ast.node.PStm... commands)Attempts to finditemand placescommandsafter it. Ifitemis not found, thencommandsis added at the top of the scope.- Specified by:
addAfterOrTopin interfaceIMablScope- Parameters:
item-commands-
-
indexOf
public int indexOf(org.intocps.maestro.ast.node.PStm stm)
- Specified by:
indexOfin interfaceIMablScope
-
activate
public ScopeFmi2Api activate()
- Specified by:
activatein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
activatein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
activatein interfaceIMablScope
-
store
public DoubleVariableFmi2Api store(double value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public StringVariableFmi2Api store(java.lang.String value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public BooleanVariableFmi2Api store(boolean value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public IntVariableFmi2Api store(int value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public DoubleVariableFmi2Api store(java.lang.String prefix, double value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public StringVariableFmi2Api store(java.lang.String prefix, java.lang.String value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public BooleanVariableFmi2Api store(java.lang.String name, boolean value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public IntVariableFmi2Api store(java.lang.String name, int value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public <V> ArrayVariableFmi2Api<V> store(java.lang.String name, V[] value)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public DoubleVariableFmi2Api store(java.util.function.Supplier<java.lang.String> nameProvider, double value)
-
store
public BooleanVariableFmi2Api store(java.util.function.Supplier<java.lang.String> nameProvider, boolean value)
-
store
public IntVariableFmi2Api store(java.util.function.Supplier<java.lang.String> nameProvider, int value)
-
store
public StringVariableFmi2Api store(java.util.function.Supplier<java.lang.String> nameProvider, java.lang.String value)
-
store
protected <V> ArrayVariableFmi2Api<V> store(java.util.function.Supplier<java.lang.String> nameProvider, V[] value)
-
getName
public java.lang.String getName(java.lang.String prefix)
- Specified by:
getNamein interfaceIMablScope
-
enterScope
public IMablScope enterScope()
- Specified by:
enterScopein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scoping<org.intocps.maestro.ast.node.PStm>- Specified by:
enterScopein interfaceIMablScope
-
store
public <V> org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Variable<org.intocps.maestro.ast.node.PStm,V> store(org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Value<V> tag)
- Specified by:
storein interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
storein interfaceIMablScope
-
store
public IntVariableFmi2Api store(java.lang.String namePrefix, IntVariableFmi2Api variable)
- Specified by:
storein interfaceIMablScope
-
store
public DoubleVariableFmi2Api store(java.lang.String namePrefix, DoubleVariableFmi2Api variable)
- Specified by:
storein interfaceIMablScope
-
storeInArray
public ArrayVariableFmi2Api storeInArray(java.lang.String namePrefix, VariableFmi2Api[] variables)
- Specified by:
storeInArrayin interfaceIMablScope
-
createFMU
public FmuVariableFmi2Api createFMU(java.lang.String name, java.lang.String loaderName, java.lang.String... args) throws java.lang.Exception
- Specified by:
createFMUin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.Scope<org.intocps.maestro.ast.node.PStm>- Specified by:
createFMUin interfaceIMablScope- Throws:
java.lang.Exception
-
copy
public <Var extends VariableFmi2Api> Var copy(java.lang.String name, Var variable)
- Specified by:
copyin interfaceIMablScope
-
createFMU
public FmuVariableFmi2Api createFMU(java.lang.String name, org.intocps.maestro.fmi.Fmi2ModelDescription modelDescription, java.net.URI path) throws java.lang.Exception
- Specified by:
createFMUin interfaceIMablScope- Throws:
java.lang.Exception
-
parent
public org.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm> parent()
- Specified by:
parentin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm>- Specified by:
parentin interfaceIMablScope
-
getDeclaration
public org.intocps.maestro.ast.node.PStm getDeclaration()
- Specified by:
getDeclarationin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm>
-
findParent
public <P extends org.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm>> P findParent(java.lang.Class<P> clz)
- Specified by:
findParentin interfaceorg.intocps.maestro.framework.fmi2.api.Fmi2Builder.ScopeElement<org.intocps.maestro.ast.node.PStm>
-
getFmiStatusVariable
public IntVariableFmi2Api getFmiStatusVariable()
- Specified by:
getFmiStatusVariablein interfaceIMablScope
-
registerComponentVariableFmi2Api
public void registerComponentVariableFmi2Api(ComponentVariableFmi2Api componentVariableFmi2Api)
Description copied from interface:IMablScopeThis is used to maintain a register of stored ComponentVariableFmi2API, such that they can be freed in case of an error.- Specified by:
registerComponentVariableFmi2Apiin interfaceIMablScope
-
findParentScope
public <S> S findParentScope(java.lang.Class<S> type)
- Specified by:
findParentScopein interfaceIMablScope
-
getAllComponentFmi2Variables
public java.util.Set<ComponentVariableFmi2Api> getAllComponentFmi2Variables()
Description copied from interface:IMablScopeRetrieves a set of allComponentFmi2Variables including those of parents- Specified by:
getAllComponentFmi2Variablesin interfaceIMablScope- Returns:
-
-