Skip to main content
×
×
Home
  • Print publication year: 2000
  • Online publication date: June 2012

17 - Association and Dictionary

from PART TWO - DATA STRUCTURES
Summary

We are all familiar with the concept of a dictionary as a fairly large book containing words and definitions. The words are always in alphabetical order to help us look up a particular word. Having the words in alphabetical order is a convenient feature but is not required. There may be other ways to find words in the dictionary, especially if our dictionary is in electronic form. Most words in a dictionary have several definitions. We associate each word with its definitions. Thus, we may characterize a dictionary as a container (possibly ordered) of associations between words and their meanings.

To take our reasoning a step further in our attempt to understand the required behavior of a dictionary, we never add definitions to a dictionary unless they are associated with a word. On the other hand, as we are building the dictionary we may add words without definitions on the promise that the definitions will be added later for those words. And finally, as we fine tune our understanding, we may change definitions for words that are already in the dictionary. We may wish to remove entries in the dictionary or access them in various ways. For example, we may wish to access a list of the words only, the meanings only, or the entire list of entries.

In Chapter 10 we defined interface Dictionary as an extension of the Container interface, interface OrderedDictionary as an extension of SearchTable, and supporting class Association.

Recommend this book

Email your librarian or administrator to recommend adding this book to your organisation's collection.

Fundamentals of OOP and Data Structures in Java
  • Online ISBN: 9780511807176
  • Book DOI: https://doi.org/10.1017/CBO9780511807176
Please enter your name
Please enter a valid email address
Who would you like to send this to *
×