Package Dict_TDA

AuthorJulien Burdy & Vincent Decorges
Date22.4.02
DescriptionA dictionary abstract data type implemantation
File namedict_tda.ads
 

Clauses

Quick access : ClausesGenericsDefinitionsSubprograms


 
Context clauses
Ada.Text_IO
 
Use clauses
Ada.Text_IO
 

Basic Objects

Quick access : ClausesGenericsDefinitionsSubprograms


Basic Objects
Name Type Default
Empty_DictDict_Typeconstant
An empty dictionary
 

Definitions

Quick access : ClausesGenericsDefinitionsSubprograms


Types
Name Declaration
Dict_Typeprivate
  
Exceptions
Key_Error
The key doesn't exist
 

Subprograms

Quick access : ClausesGenericsDefinitionsSubprograms


  
Insert procedure
Name : Insert
Purpose : Insert an entry in the dictonary

in out : L : A dictionary
in : Key : Name of a key
in : Value : Value asociate with the key
Parameter name Type Mode Default
LDict_Typein out
ValueStringin
KeyStringin
  
Delete procedure
Name : Delete
Purpose : Delete a key and its value of the dictionary
Raise Key_Error, if the key does not exist

in out : L : A dictionary
in : Key : Name of a key
Parameter name Type Mode Default
LDict_Typein out
KeyStringin
  
Update procedure
Name : Update
Purpose : Update the value of a key
if the key does not exist, insert the key
in the dictionary

in out : L : A dictionary
in : Key : Name of a key
in : Value : A value
Parameter name Type Mode Default
LDict_Typein out
ValueStringin
KeyStringin
  
Empty procedure
Name : Empty
Purpose : Empty the dictionary

in out : L : A dictionary
return : Dict_Type
Parameter name Type Mode Default
LDict_Typein out
  
Is_Empty function
ReturnBoolean
Name : Is_Empty
Purpose : Return true if the dictionary is empty

in out : L : A dictionary
return : Boolean
Parameter name Type Mode Default
LDict_Typein
  
Exist function
ReturnBoolean
Name : Exist
Purpose : Return true if a key exist in the dictionary

in : L : A dictionary
in : Key : Name of a key
return : Boolean
Parameter name Type Mode Default
LDict_Typein
KeyStringin
  
Value_Of function
ReturnString
Name : Exist
Purpose : Return the value of a key
If the key don't exist return a null string ("")

in : L : A dictionary
in : Key : Name of a key
return : String
Parameter name Type Mode Default
LDict_Typein
KeyStringin
  
Copy_Of function
ReturnDict_Type
Name : Copy_Of
Purpose : Return a copy of L

in : L : A dictionary
return : Dict_Type
Parameter name Type Mode Default
LDict_Typein
  
Put procedure
Name : Put
Purpose : Put the dictionary

in : L : A dictionary
Parameter name Type Mode Default
LDict_Typein
TargetFile_TypeinStandard_Output
  
Run_Through procedure
Name : Run_Through
Purpose : Run through the dict and call treat for each Key

in : L : A dictionary
Generic parameters
with procedure Treat (Key : in String; Value : in String)
Operation to do for each key
Parameter name Type Mode Default
LDict_Typein