Class VariableTreeTypeState
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.model.typesytem.VariableTypeState
-
- com._1c.g5.v8.dt.bsl.model.typesytem.VariableTreeTypeState
-
- All Implemented Interfaces:
IExpressionTypeState
,Comparable<VariableTypeState>
- Direct Known Subclasses:
PromiseVariableTreeTypeState
,ThreadSafeVariableTreeTypeState
public class VariableTreeTypeState extends VariableTypeState
SpecialVariableTypeState
forBslTreeTypeSystem
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VariableTreeTypeState.CurrentNumTypesNumVisiting
Special container of pair value for observation the number of visiting state
-
Field Summary
Fields Modifier and Type Field Description protected Collection<VariableTreeTypeState>
dependStates
protected Collection<org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>>>
expressions
-
Fields inherited from class com._1c.g5.v8.dt.bsl.model.typesytem.VariableTypeState
blockNode, children, typesByDependedState, typesState
-
-
Constructor Summary
Constructors Constructor Description VariableTreeTypeState(Variable variable, Environments envs, int offset, org.eclipse.xtext.nodemodel.INode blockNode)
Creates state
-
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
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
addTypes(VariableTypeState state)
Add type to state from another stateVariableTypeState
copyWithNewOffset(int newOffset)
Creates newVariableTypeState
with new offsetIterable<VariableTreeTypeState>
getDependStates()
Gets depended states on thisIterable<org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>>>
getExpressions()
Gets expression corresponding to this stateMap<VariableTreeTypeState,VariableTreeTypeState.CurrentNumTypesNumVisiting>
getPrevChildrenNumTypes()
Gets current states of childrenIterable<TypeItem>
getTypes()
Gets all types associated with this stateboolean
hasNewTypes()
Gets value flagboolean
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
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
addChildState, addExpressionRelatedTypes, addType, addTypes, compareTo, getBlockOffset, getChildState, getEnvironments, getOffset, getParentState, getSemanticObject, getTypesSize, getVariable, hasTypes, setParentState
-
-
-
-
Field Detail
-
dependStates
protected Collection<VariableTreeTypeState> dependStates
-
expressions
protected Collection<org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>>> expressions
-
-
Constructor Detail
-
VariableTreeTypeState
public VariableTreeTypeState(Variable variable, Environments envs, int offset, org.eclipse.xtext.nodemodel.INode blockNode)
Creates state- Parameters:
variable
-Variable
in BSL associated with this state, can't benull
envs
-Environments
for this state, can't benull
offset
- position in document, where this state was createdblockNode
-INode
corresponding to the containmentBlock
in Built-In Language, can't benull
-
-
Method Detail
-
getExpressions
public Iterable<org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>>> getExpressions()
Gets expression corresponding to this state- Returns:
- list of
Expression
, nevernull
-
addExpression
public void addExpression(org.eclipse.xtext.util.Pair<Expression,List<VariableTreeTypeState>> expression)
Adds expresion to the state- Parameters:
expression
- adding expression, can't benull
-
getDependStates
public Iterable<VariableTreeTypeState> getDependStates()
Gets depended states on this- Returns:
- list of
VariableTreeTypeState
, nevernull
-
addDependState
public void addDependState(VariableTreeTypeState state)
Adds depend state to the state- Parameters:
state
- adding depend state, can't benull
-
getPrevChildrenNumTypes
public Map<VariableTreeTypeState,VariableTreeTypeState.CurrentNumTypesNumVisiting> getPrevChildrenNumTypes()
Gets current states of children- Returns:
- map with key - child state, value - state of child, never
null
-
hasNewTypes
public boolean hasNewTypes()
Gets value flag- Returns:
true
if new types were add,false
otherwise
-
setHasNewTypes
public void setHasNewTypes(boolean hasNewTypes)
Sets value flag- Parameters:
hasNewTypes
-true
if new types were add,false
otherwise
-
isDependOnCollection
public boolean isDependOnCollection()
Checks that this state depend on collection's element types- Returns:
true
if this state depend on collection's element types,false
otherwise
-
isExpandTypeContextDef
public boolean isExpandTypeContextDef()
Checks that this state expands contextDef type by processingInvocation
calling- Returns:
true
if this state expands contextDef type by processingInvocation
calling,false
otherwise
-
setDependOnCollection
public void setDependOnCollection(boolean dependOnCollection)
Sets that this state depend on collection's element types- Parameters:
dependOnCollection
-true
if this state depend on collection's element types,false
otherwise
-
setExpandTypeContextDef
public void setExpandTypeContextDef(boolean expandTypeContextDef)
Sets that this state expands contextDef type by processingInvocation
calling- Parameters:
expandTypeContextDef
-true
if expand contextDef type by processingInvocation
callingfalse
otherwise
-
isServerCall
public boolean isServerCall()
Checks that this state is linked withInvocation
calling corresponding to the server call- Returns:
true
if this state linked withInvocation
calling corresponding to the server call,false
otherwise
-
setServerCall
public void setServerCall(boolean serverCall)
Sets that this state is linked withInvocation
calling corresponding to the server call- 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 classVariableTypeState
- Parameters:
newOffset
- value of new offset- Returns:
- new
VariableTypeState
-
addSkipType
public void addSkipType(String typeName)
Adds name of the type which should be deleted from state- Parameters:
typeName
- name of the deleted type, cannot benull
-
addSkipTypes
public void addSkipTypes(Collection<String> typeNames)
Adds names of the types which should be deleted from state- Parameters:
typeNames
- names of the deleted type, cannot benull
-
addAllowedType
public void addAllowedType(String typeName)
Adds name of the type which only can be contained in state- Parameters:
typeName
- name of only contained type, cannot benull
-
addAllowedTypes
public void addAllowedTypes(Collection<String> typeNames)
Adds names of the types which only can be contained in state- 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 classVariableTypeState
- 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 classVariableTypeState
- Parameters:
state
-VariableTypeState
for adding types, can't benull
-
-