Question: JAVA PROBLEM COLLECTIONS This is the code: I will copy and paste it down the bottom too so it can be easily copied. package coll.Matrix;

JAVA PROBLEM COLLECTIONS

JAVA PROBLEM COLLECTIONS This is the code: I will copy and pasteit down the bottom too so it can be easily copied. packagecoll.Matrix; import java.util.*; public class Matrix implements Iterable { /** * ConstructThis is the code: I will copy and paste it down the bottom too so it can be easily copied.

a Matrix object. * * @param rows. An int that specifies thenumber of rows. * @param columns. An int that specifies the number

package coll.Matrix;

import java.util.*;

public class Matrix implements Iterable {

/**

* Construct a Matrix object.

*

* @param rows. An int that specifies the number of rows.

* @param columns. An int that specifies the number of columns.

*/

public Matrix() {

}

/**

* Assigns a value to a given cell, specified by its row, column coordinates.

*

* @param row. An int for the row index with 0-based indexing.

* @param column. An int for the column index with 0-based indexing.

* @param value. A generic value to be assigned to the given cell.

*/

public insert() {

}

/**

* Gets the value at a given cell, specified by its row, column coordinates.

* @param row. An int for the row index with 0-based indexing.

* @param column. An int for the column index with 0-based indexing.

* @return value. A generic value located at the given cell.

*/

public get() {

}

/**

* Gets the total number of cells in the matrix.

* @return an int equal to the total number of cells in the matrix.

*/

public size() {

}

/**

* Converts the matrix to String format.

* @return a String representation of the matrix.

*/

public toString() {

}

/**

* Returns an Iterator object for the matrix. The Iterator should follow the

* order of row by row. Within each row the order is left to right.

* @return an Iterator object for the matrix.

*/

public Iterator iterator() {

}

}

Requirements A matrix is a rectangular array of values arranged in rows and columns. For example You are to implement a new collection, a Matrix. Ordinarily, new collections would implement the Collection interface, but for the purpose of this exercise, we will not do this so as to avoid implementing the eleven additional methods as part of the interface's contract However, because all collections can be instantiated with any type, your Matrix class will need to be "generic". Therefore, the tests for this exercise will attempt to instantiate and test your Matrix class using both Integer and String cell values (in separate unit tests) The provided skeleton will help you get started. The first step is to fix the current compiler errors by inserting the correct return types and parameters for each method (and constructor) according to the JavaDoc comments. Eclipse will help you with this process via suggestions. The next step is figuring out how you will internally model the Matrix. Look into Collection types that currently exist and think about how you can use them and their methods as a backbone for the class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!