Question: Bag ADT Delaware Technical Community College Program Specifications: As we prepare to explore various data structures, it's important to be able to fully understand the
Bag ADT
Delaware Technical Community College
Program Specifications:
As we prepare to explore various data structures, it's important to be able to fully understand the concept of abstraction and apply it to java.
Given a very simple "Bag" abstract data type, look at the given java interface, and implement a concrete ArrayListBag class that provides the functionality using an ArrayList as the storage mechanism.
To Do:
Implement the ArrayListBag according to the intertface
Implement a toString method in the ArrayListBag
Design and implement a test program that creates at minimum:
One bag that contains integers
One bag that contains ALL THE Pokemon from the pokemon CSV file
The bag object should end up with pokemon objects at the end of the program.
Tests removing items, including trying to remove from an empty bag
You'll only be able to test the removeItem on Integers, NOT pokemon. So please make sure you test the remove ONLY with the integer bag.
No user interaction is needed for this program.
Bag Interface:
Starter code for ITN Bag ADT Assignment
Delaware Technical Community College
public interface Bag
@param item the object to be added to the bag
@throws UnsupportedOperationException if the item cannot be added to the bag
public void addT item throws UnsupportedOperationException;
@param item the object to be removed from the bag
@return T the object removed from the bag or null if the object is not found in the bag
public T removeItemT item;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
