Skip to content

Commit

Permalink
Refactor to replace HASH_TABLE[X, STRING] with STRING_TABLE[X] in var…
Browse files Browse the repository at this point in the history
…ious places.
  • Loading branch information
wolandscat committed Aug 8, 2024
1 parent 4404e86 commit 02765fd
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ feature {NONE} -- Implementation

do_populate
local
stats_reports: HASH_TABLE [ARCHETYPE_STATISTICAL_REPORT, STRING]
stats_reports: STRING_TABLE [ARCHETYPE_STATISTICAL_REPORT]
do
create stats_reports.make (0)
safe_source.generate_statistics (differential_view)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ feature {NONE} -- Initialisation

-- ip_acknowledgements control - Hash
create evx_ip_acknowledgements.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_ip_acknowledgements_label_text),
agent : HASH_TABLE [STRING, STRING] do Result := source_archetype.description.ip_acknowledgements end,
agent : STRING_TABLE [STRING] do Result := source_archetype.description.ip_acknowledgements end,
agent (a_key, a_val: STRING) do source_archetype.description.put_ip_acknowledgements_item (a_key, a_val) end,
agent (a_key: STRING) do source_archetype.description.remove_ip_acknowledgements_item (a_key) end,
undo_redo_chain,
Expand All @@ -159,7 +159,7 @@ feature {NONE} -- Initialisation

-- conversion_details control - Hash
create evx_conversion_details.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_conversion_details_label_text),
agent : HASH_TABLE [STRING, STRING] do Result := source_archetype.description.conversion_details end,
agent : STRING_TABLE [STRING] do Result := source_archetype.description.conversion_details end,
agent (a_key, a_val: STRING) do source_archetype.description.put_conversion_details_item (a_key, a_val) end,
agent (a_key: STRING) do source_archetype.description.remove_conversion_details_item (a_key) end,
undo_redo_chain,
Expand All @@ -178,7 +178,7 @@ feature {NONE} -- Initialisation

-- original_author control - Hash
create evx_original_author.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_auth_orig_auth_label_text),
agent : HASH_TABLE [STRING, STRING] do Result := source_archetype.description.original_author end,
agent : STRING_TABLE [STRING] do Result := source_archetype.description.original_author end,
agent (a_key, a_val: STRING) do source_archetype.description.put_original_author_item (a_key, a_val) end,
agent (a_key: STRING) do source_archetype.description.remove_original_author_item (a_key) end,
undo_redo_chain, 0, min_entry_control_width_in_chars, False, Void)
Expand Down Expand Up @@ -221,7 +221,7 @@ feature {NONE} -- Initialisation
create ev_trans_author_accreditation_vbox
ev_lang_translations_hbox.extend (ev_trans_author_accreditation_vbox)
create evx_trans_author.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_translator_label_text),
agent : detachable HASH_TABLE [STRING, STRING]
agent : detachable STRING_TABLE [STRING]
do
if attached translation_details as att_td then
Result := att_td.author
Expand All @@ -246,7 +246,7 @@ feature {NONE} -- Initialisation

-- translator other_details - Hash
create evx_trans_other_details.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_translator_other_details_label_text),
agent : detachable HASH_TABLE [STRING, STRING] do if attached translation_details as att_td then Result := att_td.other_details end end,
agent : detachable STRING_TABLE [STRING] do if attached translation_details as att_td then Result := att_td.other_details end end,
agent (a_key, a_val: STRING) do if attached translation_details as att_td then att_td.put_other_details_item (a_key, a_val) end end,
agent (a_key: STRING) do if attached translation_details as att_td then att_td.remove_other_details_item (a_key) end end,
undo_redo_chain, 0, min_entry_control_width_in_chars, False, Void)
Expand Down Expand Up @@ -307,7 +307,7 @@ feature {NONE} -- Initialisation

-- original resource URIs - Hash <String, String>
create evx_original_resources.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_resource_orig_res_label_text),
agent :detachable HASH_TABLE [STRING, STRING]
agent :detachable STRING_TABLE [STRING]
do
if attached description_details as dd and then attached dd.original_resource_uri as ori then
Result := ori
Expand All @@ -321,7 +321,7 @@ feature {NONE} -- Initialisation

-- other details - Hash <String, String>
create evx_description_other_details.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_other_details_label_text),
agent :detachable HASH_TABLE [STRING, STRING]
agent :detachable STRING_TABLE [STRING]
do
if attached description_details as dd and then attached dd.other_details as od then
Result := od
Expand All @@ -342,7 +342,7 @@ feature {NONE} -- Initialisation

-- other details - Hash <String, String>
create evx_references.make_linked ("",
agent :detachable HASH_TABLE [STRING, STRING]
agent :detachable STRING_TABLE [STRING]
do
if attached source_archetype.description.references as od then
Result := od
Expand All @@ -362,7 +362,7 @@ feature {NONE} -- Initialisation

-- other details - Hash <String, String>
create evx_other_details.make_linked ("",
agent :detachable HASH_TABLE [STRING, STRING]
agent :detachable STRING_TABLE [STRING]
do
if attached source_archetype.description.other_details as od then
Result := od
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ feature -- Access

ev_root_container: EV_NOTEBOOK

source: detachable HASH_TABLE [ARCHETYPE_STATISTICAL_REPORT, STRING]
source: detachable STRING_TABLE [ARCHETYPE_STATISTICAL_REPORT]
-- stats being visualised

tool_artefact_id: STRING
Expand All @@ -70,7 +70,7 @@ feature -- Status Report

feature -- Commands

populate (a_stat_reports: HASH_TABLE [ARCHETYPE_STATISTICAL_REPORT, STRING]; diff_flag: BOOLEAN)
populate (a_stat_reports: STRING_TABLE [ARCHETYPE_STATISTICAL_REPORT]; diff_flag: BOOLEAN)
do
differential_view := diff_flag
populate_gui_tool (a_stat_reports)
Expand Down
4 changes: 2 additions & 2 deletions apps/adl_workbench/src/gui/main/gui_compilation_stats_tool.e
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ feature {NONE} -- Implementation
ev_term_bindings_info_list.item.extend (utf8_to_utf32 (stats_csr.item.count.out))
else
create list_row
list_row.extend (utf8_to_utf32 (stats_csr.key))
list_row.extend (utf8_to_utf32 (stats_csr.item.count.out))
list_row.extend (stats_csr.key.as_string_32)
list_row.extend (stats_csr.item.count.out.as_string_32)
ev_term_bindings_info_list.extend (list_row)
end
end
Expand Down
4 changes: 2 additions & 2 deletions apps/adl_workbench/src/gui/main/option_dialog.e
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ feature {NONE} -- Initialization
ev_notebook.set_item_text (ev_notebook_namespaces_vb, get_text ({ADL_MESSAGES_IDS}.ec_options_namespaces_tab_text))

create evx_namespaces.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_options_namespaces_tab_text),
agent :HASH_TABLE [STRING, STRING] do Result := namespace_table.namespaces end,
agent :STRING_TABLE [STRING] do Result := namespace_table.namespaces end,
agent (a_key, a_val: STRING) do namespace_table.put_namespace (a_key, a_val) end,
agent (a_key: STRING) do namespace_table.remove_namespace (a_key) end,
Void,
Expand All @@ -263,7 +263,7 @@ feature {NONE} -- Initialization
ev_notebook.set_item_text (ev_notebook_terminology_settings_vb, get_text ({ADL_MESSAGES_IDS}.ec_options_terminology_uris_tab_text))

create evx_terminology_settings.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_options_terminology_uris_tab_text),
agent :HASH_TABLE [STRING, STRING] do Result := terminology_settings.uri_templates end,
agent :STRING_TABLE [STRING] do Result := terminology_settings.uri_templates end,
agent (a_key, a_val: STRING) do terminology_settings.put_uri (a_key, a_val) end,
agent (a_key: STRING) do terminology_settings.remove_uri (a_key) end,
Void,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ feature -- Commands
arch_stats_report.add_models_report (arch_lib_stats, reports_csr.key)
end

out_file := file_system.new_output_file (file_system.pathname (output_dir, arch_stats_report.id + ".json"))
out_file := file_system.new_output_file (file_system.pathname (output_dir, arch_stats_report.id + {ODIN_DEFINITIONS}.file_ext_json_default))
out_file.open_write
output_to_json (arch_stats_report, out_file)
out_file.close
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ create

feature -- Access

compilation_statistics: HASH_TABLE [INTEGER, STRING]
compilation_statistics: STRING_TABLE [INTEGER]
-- Archetype library compilation stats
attribute
create Result.make(0)
end

models_reports: HASH_TABLE [ARCHETYPE_LIBRARY_STATISTICS, STRING]
models_reports: STRING_TABLE [ARCHETYPE_LIBRARY_STATISTICS]
-- Archetype library model stats, grouped by Model name, e.g. 'EHR', 'ENTITY' etc
attribute
create Result.make(0)
end

feature-- Modification

add_models_report (a_report: ARCHETYPE_LIBRARY_STATISTICS; a_key: STRING)
add_models_report (a_report: ARCHETYPE_LIBRARY_STATISTICS; a_key: READABLE_STRING_GENERAL)
do
models_reports.put (a_report, a_key)
end
Expand Down
8 changes: 4 additions & 4 deletions components/adl_compiler/src/interface/namespace_table.e
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ inherit
default_create
end

TABLE_ITERABLE [STRING, STRING]
TABLE_ITERABLE [STRING, READABLE_STRING_GENERAL]
undefine
default_create
end
Expand All @@ -50,7 +50,7 @@ feature -- Initialisation
default_create
end

make (a_namespace_table: HASH_TABLE [STRING, STRING])
make (a_namespace_table: STRING_TABLE [STRING])
-- Make from a given hash table of namespaces
-- item = namespace ref, e.g. 'oe'; key = namespace e.g. 'org.openehr'
do
Expand All @@ -76,7 +76,7 @@ feature -- Access
Result := namespaces.count
end

namespaces: HASH_TABLE [STRING, STRING]
namespaces: STRING_TABLE [STRING]
-- Hash table of namespace references, keyed by their namespace.

feature -- Status Report
Expand All @@ -94,7 +94,7 @@ feature -- Status Report

feature -- Iteration

new_cursor: TABLE_ITERATION_CURSOR [STRING, STRING]
new_cursor: TABLE_ITERATION_CURSOR [STRING, READABLE_STRING_GENERAL]
-- Fresh cursor associated with current structure
do
Result := namespaces.new_cursor
Expand Down
8 changes: 4 additions & 4 deletions components/adl_compiler/src/interface/terminology_settings.e
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ inherit
default_create
end

TABLE_ITERABLE [STRING, STRING]
TABLE_ITERABLE [STRING, READABLE_STRING_GENERAL]
undefine
default_create
end
Expand All @@ -50,7 +50,7 @@ feature -- Initialisation
default_create
end

make (a_uri_table: HASH_TABLE [STRING, STRING])
make (a_uri_table: STRING_TABLE [STRING])
-- Make from a given hash table of uris
-- item = uri ref, e.g. 'oe'; key = uri e.g. 'org.openehr'
do
Expand All @@ -76,7 +76,7 @@ feature -- Access
Result := uri_templates.count
end

uri_templates: HASH_TABLE [STRING, STRING]
uri_templates: STRING_TABLE [STRING]
-- Hash table of terminology uri templates, keyed by their terminology.

feature -- Status Report
Expand All @@ -94,7 +94,7 @@ feature -- Status Report

feature -- Iteration

new_cursor: TABLE_ITERATION_CURSOR [STRING, STRING]
new_cursor: HASH_TABLE_ITERATION_CURSOR [STRING, READABLE_STRING_GENERAL]
-- Fresh cursor associated with current structure
do
Result := uri_templates.new_cursor
Expand Down
4 changes: 2 additions & 2 deletions components/app_shell/shared_adl_app_resources.e
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ feature -- Application Switches
app_cfg.put_string_value ("/repositories/current_library_name", a_path)
end

default_namespaces: HASH_TABLE [STRING, STRING]
default_namespaces: STRING_TABLE [STRING]
once ("PROCESS")
create Result.make(0)
Result.put ("org.openehr", "oe")
Expand Down Expand Up @@ -311,7 +311,7 @@ feature -- Application Switches
app_cfg.put_object (namespace_table_path, a_namespace_table)
end

default_terminology_uri_templates: HASH_TABLE [STRING, STRING]
default_terminology_uri_templates: STRING_TABLE [STRING]
once ("PROCESS")
create Result.make(0)
Result.put ("http://snomed.info/id/$code_string", "snomedct")
Expand Down
12 changes: 6 additions & 6 deletions components/archetype_repository/src/library/archetype_library.e
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ feature -- Statistical Report
Result := compile_attempt_count = archetype_count
end

archetype_statistics: HASH_TABLE [ARCHETYPE_STATISTICAL_REPORT, STRING]
archetype_statistics: STRING_TABLE [ARCHETYPE_STATISTICAL_REPORT]
-- table of aggregated stats, keyed by BMM_SCHEMA id to which the contributing archetypes relate
-- (a single archetype library can contain archetypes of multiple RMs)
require
Expand All @@ -702,7 +702,7 @@ feature -- Statistical Report
Result := archetype_statistics_cache
end

compilation_statistics: HASH_TABLE [INTEGER, STRING]
compilation_statistics: STRING_TABLE [INTEGER]
-- set of key/value pairs, with keys from `Library_metric_names'
-- populated by call to `build_statistics'
require
Expand All @@ -714,7 +714,7 @@ feature -- Statistical Report
Result := compilation_statistics_cache
end

terminology_bindings_statistics: HASH_TABLE [ARRAYED_LIST [STRING], STRING]
terminology_bindings_statistics: STRING_TABLE [ARRAYED_LIST [STRING]]
-- table of archetypes containing terminology bindings, keyed by terminology;
-- some archetypes have more than one binding, so could appear in more than one list
require
Expand All @@ -728,19 +728,19 @@ feature -- Statistical Report

feature {NONE} -- Statistical Report

archetype_statistics_cache: HASH_TABLE [ARCHETYPE_STATISTICAL_REPORT, STRING]
archetype_statistics_cache: STRING_TABLE [ARCHETYPE_STATISTICAL_REPORT]
-- statistics reports keyed by RM schema id
attribute
create Result.make (0)
end

compilation_statistics_cache: HASH_TABLE [INTEGER, STRING]
compilation_statistics_cache: STRING_TABLE [INTEGER]
-- overall metrics, keyed by metric category
attribute
create Result.make (0)
end

terminology_bindings_statistics_cache: HASH_TABLE [ARRAYED_LIST [STRING], STRING]
terminology_bindings_statistics_cache: STRING_TABLE [ARRAYED_LIST [STRING]]
-- table of terminology stats of archetypes in this library, keyed by
-- terminology id
attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ create

feature -- Initialisation

make (a_library_name, a_component_name: STRING)
make (a_library_name, a_component_name: READABLE_STRING_GENERAL)
do
library_name := a_library_name
component_name := a_component_name
Expand All @@ -23,15 +23,15 @@ feature -- Initialisation

feature -- Access

library_name: STRING
library_name: READABLE_STRING_GENERAL

component_name: STRING
component_name: READABLE_STRING_GENERAL

model_statistics: HASH_TABLE [REPORTED_STATISTICAL_DATUM, STRING]
model_statistics: STRING_TABLE [REPORTED_STATISTICAL_DATUM]

feature -- Modification

add_model_statistics (a_stats: HASH_TABLE [STATISTICAL_DATUM, STRING])
add_model_statistics (a_stats: STRING_TABLE [STATISTICAL_DATUM])
do
across a_stats as stats_csr loop
model_statistics.put (stats_csr.item.as_report_item, stats_csr.key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ feature -- Initialisation
rm_grouped_class_table.put (default_rm_class_table, "Any")
end
if not archetype_data_value_parent_class.is_empty then
rm_grouped_class_table.put (create {HASH_TABLE [RM_CLASS_STATISTICS, STRING]}.make(0), archetype_data_value_parent_class)
rm_grouped_class_table.put (create {STRING_TABLE [RM_CLASS_STATISTICS]}.make(0), archetype_data_value_parent_class)
end
rm_grouped_class_table.put (create {HASH_TABLE [RM_CLASS_STATISTICS, STRING]}.make(0), Rm_primitive_group_key)
rm_grouped_class_table.put (create {STRING_TABLE [RM_CLASS_STATISTICS]}.make(0), Rm_primitive_group_key)
end

feature -- Access

archetype_metrics: HASH_TABLE [STATISTICAL_DATUM, STRING]
archetype_metrics: STRING_TABLE [STATISTICAL_DATUM]
-- other archetype metrics (not relating to RM), keyed by metric name
attribute
create Result.make (0)
Expand All @@ -72,15 +72,15 @@ feature -- Access
end
end

archetype_metrics_list: HASH_TABLE [LIST [STRING], STRING]
archetype_metrics_list: STRING_TABLE [LIST [STRING]]
do
create Result.make (0)
across archetype_metrics as stat_items_csr loop
Result.put (stat_items_csr.item.as_list, stat_items_csr.key)
end
end

rm_grouped_class_table: HASH_TABLE [HASH_TABLE [RM_CLASS_STATISTICS, STRING], STRING]
rm_grouped_class_table: STRING_TABLE [STRING_TABLE [RM_CLASS_STATISTICS]]
-- table of grouped stats of all RM classes, keyed by class name, with
-- each group keyed by a base class name, e.g. 'LOCATABLE', 'DATA_VALUE', 'Any' etc
attribute
Expand All @@ -103,7 +103,7 @@ feature -- Modification

add_rm_class_stats (a_stat_accum: RM_CLASS_STATISTICS)
local
rm_class_table: HASH_TABLE [RM_CLASS_STATISTICS, STRING]
rm_class_table: STRING_TABLE [RM_CLASS_STATISTICS]
do
if ref_model.is_primitive_type (a_stat_accum.rm_class_name) and then attached rm_grouped_class_table.item (Rm_primitive_group_key) as rgct_prim then
rm_class_table := rgct_prim
Expand Down Expand Up @@ -178,7 +178,7 @@ feature -- Copying

feature {NONE} -- Implementation

default_rm_class_table: HASH_TABLE [RM_CLASS_STATISTICS, STRING]
default_rm_class_table: STRING_TABLE [RM_CLASS_STATISTICS]
attribute
create Result.make (0)
end
Expand Down
Loading

0 comments on commit 02765fd

Please sign in to comment.