Date:
Mon, 15 Oct 2001 17:54:58 -0400
Content-Transfer-Encoding:
7bit
Content-Type:
text/plain; charset=us-ascii
Organization:
University of Scranton
MIME-Version:
1.0
|
Regarding:
Stephane Richard wrote:
> Just a quick question about Ada95. Is there such a thing as a Collection
> Object, or an equivalent data structure that would allow me to do the
> following, for example. Either included in Ada, or coded and available somewhere as a
> library.
>
> Create the collection
>
> TYPE Integer_List IS COLLECTION OF Integer (or something similar).
I'm not sure why you would want to do that. Use Ada's generic packaging, which is
somewhat analogous to C++ templates and Generic Java (PolyJ).
>
>
> This_List : Integer_List;
>
> ThisList.Add 12
> ThisList.Add 24
>
> ThisList.Delete 2 -- DELETE second element added to the collection.
>
> and other features to allow to manipulate this list of whichever type I
> choose. In this example it's a list of integers. But it could be a list of
> records, a list of packages (if possible), a list of pretty much anything
> available to the Ada95 Language.
There are several sources of data structure packages in Ada, you can find the Booch
components, or the packages I have used for years at
http://www.cs.uofs.edu/~beidler/Ada/index.html
Jack Beidler
--
John (Jack) Beidler, Ph.D., Professor of Computer Science
Computing Sciences Department
University of Scranton
Scranton, PA 18510
- - - - - - - - - - - - - - -
Voice: (570)941-7774 FAX: (570)941-4250
Email: [log in to unmask]
Web: http://www.cs.Scranton.edu/~beidler
|
|
|