/** * Inserts C-variable information from a map into a target scope in the program database. * * @param target a scope into which fields are to be inserted * @param fields a map of String->ContainedConnection. The ContainedConnection */ public static void transferFields( Scope<Namespace> target, Map<String, ContainedConnection<Entity, Field>> fields) { Collection<ContainedConnection<Entity, Field>> fieldSet = fields.values(); // Go over fields in the set, insert each of them to the target // scope for (ContainedConnection<Entity, Field> element : fieldSet) { // Each member of the fields map is a contained-connection which // describes field visibility and storage with reference to the // target scope Field field = element.getContained(); target.addMember(field, element.getVisibility(), element.getStorage()); } }