AdapterHomework

AdapterHomework - (), go through the returned array and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Adapter Homework This homework is based on the Adapter in-class exercise we did on Feb. 11, 2010. You will extend the in-class exercise to work not only with Document but also with MyData hierarchy which are described below. classes are provided in MyData.zip. Your Test program has to ask user whether to work with Document or objects. Then ask user how many objects to create for the chosen type and the values to initialize objects. If user chose to work with objects, your program ask user to choose from MyPositiveInteger , MyNegativeInteger or MyDouble objects. You need to implement your own adapter for . After your program call copyArray
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (), go through the returned array and print out the object type and value in each array element. Use hierarchy’s toString () which is implemented to return a String containing the object type and value. For example, ac is an instance of ArrayCopier , resturnedArray = ac.copyArray (). Assume that Object ae = returnedArray [i], use System.out.println(ae) to call () method in each MyData object. If you need to know what are the criteria used for isValid (), getLow () tells you the lower bound and getHigh () tells you the higher bound. Due Date: February 18, 2010...
View Full Document

This note was uploaded on 01/17/2012 for the course GCIS 518 taught by Professor Tang during the Spring '10 term at Gannon.

Ask a homework question - tutors are online