Package org.eclipse.m2m.atl.emftvm.util
Class FieldContainer
java.lang.Object
org.eclipse.m2m.atl.emftvm.util.FieldContainer
Reusable class for storage and lookup of
Fields.-
Field Summary
FieldsModifier and TypeFieldDescriptionSet of all fields (for clearing values).Lookup table for fields: (name -> (context -> field)).Lookup table for static fields: (name -> (context -> field)). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the values of all registered fields.Finds the corresponding field forfindStaticField(Object context, String name) Finds the corresponding static field forbooleanReturnstrueiff this execution environment has any registered fields with the givenname.booleanhasStaticField(String name) Returnstrueiff this execution environment has any registered static fields with the givenname.voidRegisters f in the corresponding lookup table.toString()
-
Field Details
-
fields
Lookup table for fields: (name -> (context -> field)). -
staticFields
Lookup table for static fields: (name -> (context -> field)). -
allFields
Set of all fields (for clearing values).
-
-
Constructor Details
-
FieldContainer
public FieldContainer()
-
-
Method Details
-
registerField
Registers f in the corresponding lookup table.- Parameters:
f- the field to register
-
findField
Finds the corresponding field forname
andcontext
.- Parameters:
context- the context type of the fieldname- the name of the field- Returns:
- the corresponding field, or
nullif not found - Throws:
DuplicateEntryException- if there is a field conflict
-
hasField
Returnstrueiff this execution environment has any registered fields with the givenname.- Parameters:
name- the field name- Returns:
trueiff this execution environment has any registered fields with the givenname
-
findStaticField
Finds the corresponding static field forname
andcontext
.- Parameters:
context- the context type of the fieldname- the name of the field- Returns:
- the corresponding field, or
nullif not found - Throws:
DuplicateEntryException- if there is a field conflict
-
hasStaticField
Returnstrueiff this execution environment has any registered static fields with the givenname.- Parameters:
name- the field name- Returns:
trueiff this execution environment has any registered static fields with the givenname
-
clear
public void clear()Clears the values of all registered fields. -
toString
-