Class PromiseVariableTreeTypeState
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.model.typesytem.VariableTypeState
-
- com._1c.g5.v8.dt.bsl.model.typesytem.VariableTreeTypeState
-
- com._1c.g5.v8.dt.bsl.model.typesytem.PromiseVariableTreeTypeState
-
- All Implemented Interfaces:
IExpressionTypeState
,Comparable<VariableTypeState>
public class PromiseVariableTreeTypeState extends VariableTreeTypeState
SpecialVariableTreeTypeState
for async methods. Wraps normalVariableTreeTypeState
and only changes methodsgetTypes()
- all types from wrappingVariableTreeTypeState
will be put toPromiseType
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com._1c.g5.v8.dt.bsl.model.typesytem.VariableTreeTypeState
VariableTreeTypeState.CurrentNumTypesNumVisiting
-
-
Field Summary
-
Fields inherited from class com._1c.g5.v8.dt.bsl.model.typesytem.VariableTreeTypeState
dependStates, expressions
-
Fields inherited from class com._1c.g5.v8.dt.bsl.model.typesytem.VariableTypeState
blockNode, children, typesByDependedState, typesState
-
-
Constructor Summary
Constructors Constructor Description PromiseVariableTreeTypeState(VariableTreeTypeState state)
Creates newVariableTreeTypeState
for async methods
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllowedType(String typeName)
Adds name of the type which only can be contained in statevoid
addAllowedTypes(Collection<String> typeNames)
Adds names of the types which only can be contained in statevoid
addChildState(IExpressionTypeState childState)
Add new child state.void
addDependState(VariableTreeTypeState state)
Adds depend state to the statevoid
addExpression(org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>> expression)
Adds expresion to the statevoid
addSkipType(String typeName)
Adds name of the type which should be deleted from statevoid
addSkipTypes(Collection<String> typeNames)
Adds names of the types which should be deleted from statevoid
addType(TypeItem type)
Add type to statevoid
addTypes(VariableTypeState state)
Add type to state from another statevoid
addTypes(Collection<? extends TypeItem> types)
Add types to stateint
compareTo(VariableTypeState state)
VariableTypeState
copyWithNewOffset(int newOffset)
Creates newVariableTypeState
with new offsetIterable<IExpressionTypeState>
getChildState()
Gets children states for current stateIterable<VariableTreeTypeState>
getDependStates()
Gets depended states on thisIterable<org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>>>
getExpressions()
Gets expression corresponding to this stateIExpressionTypeState
getParentState()
Gets state that was before current stateMap<VariableTreeTypeState,VariableTreeTypeState.CurrentNumTypesNumVisiting>
getPrevChildrenNumTypes()
Gets current states of childrenorg.eclipse.emf.ecore.EObject
getSemanticObject()
Gets semantic model object corresponding to the this stateIterable<TypeItem>
getTypes()
Gets all types associated with this stateint
getTypesSize()
Gets type's list sizeboolean
hasNewTypes()
Gets value flagboolean
hasTypes()
Checks that state has assosiated typesboolean
isDependOnCollection()
Checks that this state depend on collection's element typesboolean
isExpandTypeContextDef()
Checks that this state expands contextDef type by processingInvocation
callingboolean
isServerCall()
Checks that this state is linked withInvocation
calling corresponding to the server callvoid
setDependOnCollection(boolean dependOnCollection)
Sets that this state depend on collection's element typesvoid
setExpandTypeContextDef(boolean expandTypeContextDef)
Sets that this state expands contextDef type by processingInvocation
callingvoid
setHasNewTypes(boolean hasNewTypes)
Sets value flagvoid
setParentState(IExpressionTypeState parentState)
Sets state that was before current state.void
setServerCall(boolean serverCall)
Sets that this state is linked withInvocation
calling corresponding to the server call-
Methods inherited from class com._1c.g5.v8.dt.bsl.model.typesytem.VariableTypeState
addExpressionRelatedTypes, getBlockOffset, getEnvironments, getOffset, getVariable
-
-
-
-
Constructor Detail
-
PromiseVariableTreeTypeState
public PromiseVariableTreeTypeState(VariableTreeTypeState state)
Creates newVariableTreeTypeState
for async methods- Parameters:
state
- normalVariableTreeTypeState
wrapped for async method, cannot benull
-
-
Method Detail
-
getExpressions
public Iterable<org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>>> getExpressions()
Description copied from class:VariableTreeTypeState
Gets expression corresponding to this state- Overrides:
getExpressions
in classVariableTreeTypeState
- Returns:
- list of
Expression
, nevernull
-
addExpression
public void addExpression(org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>> expression)
Description copied from class:VariableTreeTypeState
Adds expresion to the state- Overrides:
addExpression
in classVariableTreeTypeState
- Parameters:
expression
- adding expression, can't benull
-
getDependStates
public Iterable<VariableTreeTypeState> getDependStates()
Description copied from class:VariableTreeTypeState
Gets depended states on this- Overrides:
getDependStates
in classVariableTreeTypeState
- Returns:
- list of
VariableTreeTypeState
, nevernull
-
addDependState
public void addDependState(VariableTreeTypeState state)
Description copied from class:VariableTreeTypeState
Adds depend state to the state- Overrides:
addDependState
in classVariableTreeTypeState
- Parameters:
state
- adding depend state, can't benull
-
getPrevChildrenNumTypes
public Map<VariableTreeTypeState,VariableTreeTypeState.CurrentNumTypesNumVisiting> getPrevChildrenNumTypes()
Description copied from class:VariableTreeTypeState
Gets current states of children- Overrides:
getPrevChildrenNumTypes
in classVariableTreeTypeState
- Returns:
- map with key - child state, value - state of child, never
null
-
hasNewTypes
public boolean hasNewTypes()
Description copied from class:VariableTreeTypeState
Gets value flag- Overrides:
hasNewTypes
in classVariableTreeTypeState
- Returns:
true
if new types were add,false
otherwise
-
setHasNewTypes
public void setHasNewTypes(boolean hasNewTypes)
Description copied from class:VariableTreeTypeState
Sets value flag- Overrides:
setHasNewTypes
in classVariableTreeTypeState
- Parameters:
hasNewTypes
-true
if new types were add,false
otherwise
-
isDependOnCollection
public boolean isDependOnCollection()
Description copied from class:VariableTreeTypeState
Checks that this state depend on collection's element types- Overrides:
isDependOnCollection
in classVariableTreeTypeState
- Returns:
true
if this state depend on collection's element types,false
otherwise
-
isExpandTypeContextDef
public boolean isExpandTypeContextDef()
Description copied from class:VariableTreeTypeState
Checks that this state expands contextDef type by processingInvocation
calling- Overrides:
isExpandTypeContextDef
in classVariableTreeTypeState
- Returns:
true
if this state expands contextDef type by processingInvocation
calling,false
otherwise
-
setDependOnCollection
public void setDependOnCollection(boolean dependOnCollection)
Description copied from class:VariableTreeTypeState
Sets that this state depend on collection's element types- Overrides:
setDependOnCollection
in classVariableTreeTypeState
- Parameters:
dependOnCollection
-true
if this state depend on collection's element types,false
otherwise
-
setExpandTypeContextDef
public void setExpandTypeContextDef(boolean expandTypeContextDef)
Description copied from class:VariableTreeTypeState
Sets that this state expands contextDef type by processingInvocation
calling- Overrides:
setExpandTypeContextDef
in classVariableTreeTypeState
- Parameters:
expandTypeContextDef
-true
if expand contextDef type by processingInvocation
callingfalse
otherwise
-
isServerCall
public boolean isServerCall()
Description copied from class:VariableTreeTypeState
Checks that this state is linked withInvocation
calling corresponding to the server call- Overrides:
isServerCall
in classVariableTreeTypeState
- Returns:
true
if this state linked withInvocation
calling corresponding to the server call,false
otherwise
-
setServerCall
public void setServerCall(boolean serverCall)
Description copied from class:VariableTreeTypeState
Sets that this state is linked withInvocation
calling corresponding to the server call- Overrides:
setServerCall
in classVariableTreeTypeState
- Parameters:
serverCall
-true
if this state linked withInvocation
calling corresponding to the server call,false
otherwise
-
copyWithNewOffset
public VariableTypeState copyWithNewOffset(int newOffset)
Description copied from class:VariableTypeState
Creates newVariableTypeState
with new offset- Overrides:
copyWithNewOffset
in classVariableTreeTypeState
- Parameters:
newOffset
- value of new offset- Returns:
- new
VariableTypeState
-
addSkipType
public void addSkipType(String typeName)
Description copied from class:VariableTreeTypeState
Adds name of the type which should be deleted from state- Overrides:
addSkipType
in classVariableTreeTypeState
- Parameters:
typeName
- name of the deleted type, cannot benull
-
addSkipTypes
public void addSkipTypes(Collection<String> typeNames)
Description copied from class:VariableTreeTypeState
Adds names of the types which should be deleted from state- Overrides:
addSkipTypes
in classVariableTreeTypeState
- Parameters:
typeNames
- names of the deleted type, cannot benull
-
addAllowedType
public void addAllowedType(String typeName)
Description copied from class:VariableTreeTypeState
Adds name of the type which only can be contained in state- Overrides:
addAllowedType
in classVariableTreeTypeState
- Parameters:
typeName
- name of only contained type, cannot benull
-
addAllowedTypes
public void addAllowedTypes(Collection<String> typeNames)
Description copied from class:VariableTreeTypeState
Adds names of the types which only can be contained in state- Overrides:
addAllowedTypes
in classVariableTreeTypeState
- Parameters:
typeNames
- names of only contained type, cannot benull
-
getTypes
public Iterable<TypeItem> getTypes()
Description copied from class:VariableTypeState
Gets all types associated with this state- Specified by:
getTypes
in interfaceIExpressionTypeState
- Overrides:
getTypes
in classVariableTreeTypeState
- Returns:
- list of
TypeItem
-
addTypes
public void addTypes(VariableTypeState state)
Description copied from interface:IExpressionTypeState
Add type to state from another state- Specified by:
addTypes
in interfaceIExpressionTypeState
- Overrides:
addTypes
in classVariableTreeTypeState
- Parameters:
state
-VariableTypeState
for adding types, can't benull
-
addTypes
public void addTypes(Collection<? extends TypeItem> types)
Description copied from interface:IExpressionTypeState
Add types to state- Specified by:
addTypes
in interfaceIExpressionTypeState
- Overrides:
addTypes
in classVariableTypeState
- Parameters:
types
- addingTypeItem
s, can't benull
-
addType
public void addType(TypeItem type)
Description copied from interface:IExpressionTypeState
Add type to state- Specified by:
addType
in interfaceIExpressionTypeState
- Overrides:
addType
in classVariableTypeState
- Parameters:
type
- addingTypeItem
, can't benull
-
hasTypes
public boolean hasTypes()
Description copied from interface:IExpressionTypeState
Checks that state has assosiated types- Specified by:
hasTypes
in interfaceIExpressionTypeState
- Overrides:
hasTypes
in classVariableTypeState
- Returns:
true
if there are assosiated types in state,false
otherwise
-
getTypesSize
public int getTypesSize()
Description copied from interface:IExpressionTypeState
Gets type's list size- Specified by:
getTypesSize
in interfaceIExpressionTypeState
- Overrides:
getTypesSize
in classVariableTypeState
- Returns:
- count of types in
VariableTypeState
-
getParentState
public IExpressionTypeState getParentState()
Description copied from class:VariableTypeState
Gets state that was before current state- Specified by:
getParentState
in interfaceIExpressionTypeState
- Overrides:
getParentState
in classVariableTypeState
- Returns:
- parent state
-
setParentState
public void setParentState(IExpressionTypeState parentState)
Description copied from class:VariableTypeState
Sets state that was before current state.
Remark that inIExpressionTypeState.addChildState(IExpressionTypeState)
parent state set automatically- Specified by:
setParentState
in interfaceIExpressionTypeState
- Overrides:
setParentState
in classVariableTypeState
- Parameters:
parentState
- parent state
-
getChildState
public Iterable<IExpressionTypeState> getChildState()
Description copied from class:VariableTypeState
Gets children states for current state- Specified by:
getChildState
in interfaceIExpressionTypeState
- Overrides:
getChildState
in classVariableTypeState
- Returns:
- list of
IExpressionTypeState
-
addChildState
public void addChildState(IExpressionTypeState childState)
Description copied from class:VariableTypeState
Add new child state.
Remarks that current state will be parent state forchildState
- Specified by:
addChildState
in interfaceIExpressionTypeState
- Overrides:
addChildState
in classVariableTypeState
- Parameters:
childState
- new child
-
compareTo
public int compareTo(VariableTypeState state)
Description copied from class:VariableTypeState
- Specified by:
compareTo
in interfaceComparable<VariableTypeState>
- Overrides:
compareTo
in classVariableTypeState
-
getSemanticObject
public org.eclipse.emf.ecore.EObject getSemanticObject()
Description copied from class:VariableTypeState
Gets semantic model object corresponding to the this state- Overrides:
getSemanticObject
in classVariableTypeState
- Returns:
- semantic model object corresponding to the this state, can't be
null
if there is no semantic object for this state
-
-