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
Field
s.-
Field Summary
Modifier 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the values of all registered fields.Finds the corresponding field forfindStaticField
(Object context, String name) Finds the corresponding static field forboolean
Returnstrue
iff this execution environment has any registered fields with the givenname
.boolean
hasStaticField
(String name) Returnstrue
iff this execution environment has any registered static fields with the givenname
.void
Registers 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
null
if not found - Throws:
DuplicateEntryException
- if there is a field conflict
-
hasField
Returnstrue
iff this execution environment has any registered fields with the givenname
.- Parameters:
name
- the field name- Returns:
true
iff 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
null
if not found - Throws:
DuplicateEntryException
- if there is a field conflict
-
hasStaticField
Returnstrue
iff this execution environment has any registered static fields with the givenname
.- Parameters:
name
- the field name- Returns:
true
iff this execution environment has any registered static fields with the givenname
-
clear
public void clear()Clears the values of all registered fields. -
toString
-