Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

shape class implementation contains contains only compute area and other shapes implementation, so it doesnt matter Implement a class ShapeCollection to manage shape objects (copy-paste

image text in transcribed

shape class implementation contains contains only compute area and other shapes implementation, so it doesnt matter

Implement a class ShapeCollection to manage shape objects (copy-paste the provided skeleton to finish the implementation); The class should have a static shape data structure, called shapes, to hold shape objects. The class should implement all the behaviors as in the skeleton code below. Skeleton code Class ShapeCollection { public ShapeCollection () { } public Iterator getShapes (){} public void addShape (Shape shape) { /* the method should insert a shape in shapes, * the method should double check that the input object * is not a duplicate +/ } public void removeShape (Shape shape) { } public void sortShapes () { /* sort shape objects by area using the natural ordering of elements* } public List searchShapes (double area) { } /* save and load shapes from the hard disk * using object serialization public void loadShapes (){} public void saveShapes () {} } Implement a class ShapeCollection to manage shape objects (copy-paste the provided skeleton to finish the implementation); The class should have a static shape data structure, called shapes, to hold shape objects. The class should implement all the behaviors as in the skeleton code below. Skeleton code Class ShapeCollection { public ShapeCollection () { } public Iterator getShapes (){} public void addShape (Shape shape) { /* the method should insert a shape in shapes, * the method should double check that the input object * is not a duplicate +/ } public void removeShape (Shape shape) { } public void sortShapes () { /* sort shape objects by area using the natural ordering of elements* } public List searchShapes (double area) { } /* save and load shapes from the hard disk * using object serialization public void loadShapes (){} public void saveShapes () {} }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago