92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
=> Dict_Entry (Dict, I)
= Dict_Entry (Append_String'Result, I))
and then Dict_Entry (Append_String'Result,
Append_String'Result.Dict_Last)
= Value;
-- Return a new dictionary with Value appended
List_For_Linear_Search : String_Lists.List;
function Linear_Search (Value : String) return Natural;
-- Function and data source for inefficient but dynamic function
-- that can be used with Dictionary.Hash.
procedure Set_Dictionary_For_Map_Search (Dict : in Dictionary);
function Map_Search (Value : String) return Natural;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
=> Dict_Entry (Dict, I)
= Dict_Entry (Append_String'Result, I))
and then Dict_Entry (Append_String'Result,
Append_String'Result.Dict_Last)
= Value;
-- Return a new dictionary with Value appended
function Replace_Element
(Dict : in Dictionary;
Index : in Ada.Streams.Stream_Element;
Value : in String)
return Dictionary
with Pre => Index <= Dict.Dict_Last and then Value'Length > 0,
Post => Dict.Dict_Last = Replace_Element'Result.Dict_Last
and then (for all I in 0 .. Dict.Dict_Last
=> (I = Index or else Dict_Entry (Dict, I)
= Dict_Entry (Replace_Element'Result, I)))
and then Dict_Entry (Replace_Element'Result, Index) = Value;
-- Return a new dictionary with entry at Index replaced by Value
List_For_Linear_Search : String_Lists.List;
function Linear_Search (Value : String) return Natural;
-- Function and data source for inefficient but dynamic function
-- that can be used with Dictionary.Hash.
procedure Set_Dictionary_For_Map_Search (Dict : in Dictionary);
function Map_Search (Value : String) return Natural;
|