Generic Sequences

Objective
The purpose of this project is to develop a generic class representing the sequence
data structure. For storage of data the class shall use an ArrayList object. You will also
review how to construct and use Java classes as well as obtain experience with
software design and testing.
ABET Program Learning Outcomes:
The ability to recognize the need for data structures and choose the appropriate
data structure (1, 2, 6)
The Problem
In this project you implement a sequence ADT as defined in the book. However, your
class will be ArrayList based rather than array based. The fields will be chosen
accordingly and in the application class you will test and demonstrate the behavior of
the sequence ADT.
Design, Implementation
The reading book provides good help and patterns for design and implementation.
However, as opposed to the concrete types used in the book, you shall implement a
generic
Sequence class for the data structure. In another class named Applications
you shall test and exercise the Sequence methods. For this purpose the generic code
will be run with the concrete type Integer from the Java library.
1. Sequence class specification
This class will represent a set sequence, that is duplicate values are not
supposed to be in the sequence. You do not have to ensure this property at
adding elements, we may consider this a precondition for all methods. You may
opt for implementing a bag sequence, in that case you should change the field,
see comment below. The specification of a non-generic DoubleArraySeq class is
fairly well detailed in your reading, pp 150
– 158. Follow that design when
adequate and care for the differences as consequences of generic
implementation and ArrayList storage.

Leave a Reply

Your email address will not be published. Required fields are marked *