Question: USE JAVA Language Make require and neccesary change in my code, also add extra and required data in my code Each student, independent of each
USE JAVA Language
Make require and neccesary change in my code, also add extra and required data in my code
Each student, independent of each other, should populate their interface with some hard coded data (for example, name of computer image, application name, data size, and so on).
This is the question - Panel for computer images. This panel would allow the user to examine an image: list applications in that image, view additional data needs for each application, view the total data requirements . Also consider how an application may be removed .
Existing code:
Image.java
package HCIproject;
import java.util.ArrayList;
public class Image
{
private String name;
// List for AppObject
private ArrayList appObjectList = new ArrayList ();
// List for AppObject data
private ArrayList appDataList = new ArrayList ();
/**
*
* @return
*/
public String getName()
{
return name;
}
/**
*
* @param name
*/
public void setName(String name)
{
this.name = name;
}
/**
*
* @param a
* @param i
*/
public void addApplication(AppObject a, int i)
{
// Add to each list
appObjectList.add(a);
appDataList.add(new Integer(i));
}
/**
*
* @param a
* @param i
*/
public void setApplicationData(AppObject a, int i)
{
// Get the index of the object and add to the data list
appDataList.set(appObjectList.indexOf(a), new Integer(i));
}
/**
*
* @param a
*/
public void removeApplication(AppObject a)
{
// Remove from both the list
appDataList.remove(appObjectList.indexOf(a));
appObjectList.remove(a);
}
/**
*
* @return
*/
public int getNumberOfApplications()
{
// Return the count of App object
return appObjectList.size();
}
/**
*
* @param i
* @return
*/
public AppObject getApplication(int i)
{
// Get the application
return appObjectList.get(i);
}
/**
*
* @param i
* @return
*/
public int getApplicationExtraData(int i)
{
// Get application data
return appDataList.get(i).intValue();
}
}
AppObject.java
package HCIproject;
public class AppObject
{
// Data members of the App objects
private String name;
private int diskSize;
private int coresUsed;
private int ramSize;
// Getters and setters
/**
*
* @return
*/
public String getName()
{
return name;
}
/**
*
* @param name
*/
public void setName(String name)
{
this.name = name;
}
/**
*
* @return
*/
public int getDiskSize()
{
return diskSize;
}
/**
*
* @param diskSize
*/
public void setDiskSize(int diskSize)
{
this.diskSize = diskSize;
}
/**
*
* @return
*/
public int getCoresUsed()
{
return coresUsed;
}
/**
*
* @param coresUsed
*/
public void setCoresUsed(int coresUsed)
{
this.coresUsed = coresUsed;
}
/**
*
* @return
*/
public int getRamSize()
{
return ramSize;
}
/**
*
* @param ramSize
*/
public void setRamSize(int ramSize)
{
this.ramSize = ramSize;
}
}
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
