SlideShare a Scribd company logo
Java Programming:
In this programming assignment, you need to implement a storage manager that maintains a
series of data objects in each data file. Include a main method file as well. Below is the
FileManager.java that has errors. Attached are images where the errors are circled. Make sure
there are no error in the code at all and show the output.
FileManager,java
import java.io.IOException;
import java.util.Iterator;
public class FileManager {
public void put(int fileID, Long location, Object o) throws IOException,
InvalidLocationException {
if (first(location) < 0) {
throw new InvalidLocationException();
}
SlottedPage p = page(fileID, first(location));
p.put(second(location), o);
updated(p, fileID);
}
private void updated(SlottedPage p, int fileID) {
// TODO Auto-generated method stub
}
public Object get(int fileID, Long location) throws IOException, InvalidLocationException {
if (first(location) < 0) {
throw new InvalidLocationException();
}
SlottedPage p = page(fileID, first(location));
return p.get(second(location));
}
public Object remove(int fileID, Long location) throws IOException,
InvalidLocationException {
if (first(location) < 0) {
throw new InvalidLocationException();
}
SlottedPage p = page(fileID, first(location));
return p.remove(second(location));
}
private SlottedPage page(int fileID, Object first) {
// TODO Auto-generated method stub
return null;
}
private Object first(Long location) {
// TODO Auto-generated method stub
return null;
}
private int second(Long location) {
// TODO Auto-generated method stub
return 0;
}
public Iterator iterator(int fileID) throws IOException {
SlottedPage[] pages = pages(fileID);
return new PageIterator(pages);
}
private SlottedPage[] pages(int fileID) {
// TODO Auto-generated method stub
return null;
}
}
import java.io.IOException; public class FileManager { public void put(int fileID, Long
location, Object o) throws IOException, InvalidLocationException if (first ( location )<0){ throw
new InvodialocationException(); } SlottedPage p= page(fileID, first(location)); p put
(second(location), o); undaced (p, fileID); } private void updated(SlottedPage p, int fileID) { //
TODO Auto-generated method stub public Object get(int filetD Long location) throws
IOException, InvalidLocationException { if (first(location) timow IlW
InvailatocationException(); } SlottedPage p = page(fileID, first(location)); return
p.get(second(location));

More Related Content

PDF
In the context of fraud explain the differences between (1) incentiv.pdf
PDF
In the article liars dont qualify by Junius Edwards, What does the .pdf
PDF
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
PDF
In the early 1970s, the US economy experienced a strong increase in.pdf
PDF
In the context of crystallization of monazite in a silicate melt, La.pdf
PDF
in the article liars dont qualify, y Junius Edwards, What does the .pdf
PDF
In which of the following ways can you not use a subquery in a SELEC.pdf
PDF
In the Government of Canada, individuals within departments to whom .pdf
In the context of fraud explain the differences between (1) incentiv.pdf
In the article liars dont qualify by Junius Edwards, What does the .pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In the early 1970s, the US economy experienced a strong increase in.pdf
In the context of crystallization of monazite in a silicate melt, La.pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdf
In which of the following ways can you not use a subquery in a SELEC.pdf
In the Government of Canada, individuals within departments to whom .pdf

More from sanjeevbansal1970 (20)

PDF
In Xcode, Using decomposition, type the code that will most efficien.pdf
PDF
In the article liars dont qualify by Junius Edwards, What is the pu.pdf
PDF
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
PDF
John is a minor who lives with his mother and stepfather and not his.pdf
PDF
John and Sara are married and live in AZ. They do not have a prenup.pdf
PDF
In Visual Studios C# console app using multiple class files create a.pdf
PDF
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
PDF
Jin has configured File History on his Windows 10 computer using an .pdf
PDF
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
PDF
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
PDF
Jean has her first child at age 14. By the time she is 30, she has f.pdf
PDF
JavaScriptIn this project you will create an interactive map for a.pdf
PDF
JAVA Assistance please! I need help with a Java GUI. I have to put a.pdf
PDF
In this programming assignment, you will be creating a Health Inform.pdf
PDF
Japonyann GSYHsnn 4 trilyon $ olduunu ve ulusal tasarruf orannn 1.pdf
PDF
Janelle is pretty lucky. She doesnt have a lot of out-of-pocket exp.pdf
PDF
Jane is planning to go on a camping trip. She purchases a bottle of .pdf
PDF
James Fishel is a 56-year-old maintenance worker who has worked for .pdf
PDF
Jackson abri� su negocio en febrero. Debido a circunstancias fuera d.pdf
PDF
ITT will pay a dividend of $2.40 a share next year (D1). The price o.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John is a minor who lives with his mother and stepfather and not his.pdf
John and Sara are married and live in AZ. They do not have a prenup.pdf
In Visual Studios C# console app using multiple class files create a.pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Jin has configured File History on his Windows 10 computer using an .pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdf
JavaScriptIn this project you will create an interactive map for a.pdf
JAVA Assistance please! I need help with a Java GUI. I have to put a.pdf
In this programming assignment, you will be creating a Health Inform.pdf
Japonyann GSYHsnn 4 trilyon $ olduunu ve ulusal tasarruf orannn 1.pdf
Janelle is pretty lucky. She doesnt have a lot of out-of-pocket exp.pdf
Jane is planning to go on a camping trip. She purchases a bottle of .pdf
James Fishel is a 56-year-old maintenance worker who has worked for .pdf
Jackson abri� su negocio en febrero. Debido a circunstancias fuera d.pdf
ITT will pay a dividend of $2.40 a share next year (D1). The price o.pdf
Ad

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Lesson notes of climatology university.
PPTX
Cell Types and Its function , kingdom of life
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Sports Quiz easy sports quiz sports quiz
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Pre independence Education in Inndia.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Cell Structure & Organelles in detailed.
PPTX
master seminar digital applications in india
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Classroom Observation Tools for Teachers
PPTX
Institutional Correction lecture only . . .
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
Microbial disease of the cardiovascular and lymphatic systems
Lesson notes of climatology university.
Cell Types and Its function , kingdom of life
Renaissance Architecture: A Journey from Faith to Humanism
Sports Quiz easy sports quiz sports quiz
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
O7-L3 Supply Chain Operations - ICLT Program
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Pre independence Education in Inndia.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Cell Structure & Organelles in detailed.
master seminar digital applications in india
Computing-Curriculum for Schools in Ghana
Microbial diseases, their pathogenesis and prophylaxis
Classroom Observation Tools for Teachers
Institutional Correction lecture only . . .
human mycosis Human fungal infections are called human mycosis..pptx
Ad

Java Programming In this programming assignment, you need to impl.pdf

  • 1. Java Programming: In this programming assignment, you need to implement a storage manager that maintains a series of data objects in each data file. Include a main method file as well. Below is the FileManager.java that has errors. Attached are images where the errors are circled. Make sure there are no error in the code at all and show the output. FileManager,java import java.io.IOException; import java.util.Iterator; public class FileManager { public void put(int fileID, Long location, Object o) throws IOException, InvalidLocationException { if (first(location) < 0) { throw new InvalidLocationException(); } SlottedPage p = page(fileID, first(location)); p.put(second(location), o); updated(p, fileID); } private void updated(SlottedPage p, int fileID) { // TODO Auto-generated method stub } public Object get(int fileID, Long location) throws IOException, InvalidLocationException { if (first(location) < 0) { throw new InvalidLocationException(); } SlottedPage p = page(fileID, first(location)); return p.get(second(location)); } public Object remove(int fileID, Long location) throws IOException, InvalidLocationException { if (first(location) < 0) { throw new InvalidLocationException();
  • 2. } SlottedPage p = page(fileID, first(location)); return p.remove(second(location)); } private SlottedPage page(int fileID, Object first) { // TODO Auto-generated method stub return null; } private Object first(Long location) { // TODO Auto-generated method stub return null; } private int second(Long location) { // TODO Auto-generated method stub return 0; } public Iterator iterator(int fileID) throws IOException { SlottedPage[] pages = pages(fileID); return new PageIterator(pages); } private SlottedPage[] pages(int fileID) { // TODO Auto-generated method stub return null; } } import java.io.IOException; public class FileManager { public void put(int fileID, Long location, Object o) throws IOException, InvalidLocationException if (first ( location )<0){ throw new InvodialocationException(); } SlottedPage p= page(fileID, first(location)); p put (second(location), o); undaced (p, fileID); } private void updated(SlottedPage p, int fileID) { // TODO Auto-generated method stub public Object get(int filetD Long location) throws IOException, InvalidLocationException { if (first(location) timow IlW
  • 3. InvailatocationException(); } SlottedPage p = page(fileID, first(location)); return p.get(second(location));