代写 data structure Java database Task Description

Task Description
In this assignment we will develop a key value store called DBLite in the Java programming language using dynamic data structures, ensuring that no errors occur. Each entry of the database is identified by a unique key string and contains a dynamically sized list of integer values.
You are encouraged to ask questions on Ed using the assignments category. As with any assignment, make sure that your work is your own, and you do not share your code or solutions with other students.
Working on your assignment
You can work on this assignment on your own computer or the lab machines. It is important that you continually back up your assignment files onto your own machine, external drives, and in the cloud.
You are encouraged to submit your assignment on Ed while you are in the process of completing it. By submitting you will obtain some feedback of your progress on the sample test cases provided.
1

Implementation details
Write a program in Java that implements DBLite as shown in the examples below. You can assum e that our test cases will contain only valid input commands and not cause any integer overflows. Keys are case sensitive and do not contain spaces. Commands are case insensitive.
Entry values are indexed from 1. Snapshots are indexed from 1 and are unique for the lifetime of the program. Keys, entries and snapshots are to be outputted in the order from most recently added to least recently added.
Your program must be contained in DBLite.java, Snapshot.java and Entry.java and produce no errors when built and run on the lab machines and Ed. Reading from standard input and writing to standard output.
Your program output must match the exact output format shown in the examples and on Ed. You are
encouraged to subm it your assignment
while you are working
on it, so you can obtain some feedba c k .
Y o u ha v e be e n pr o v i d e d a snapshot database.
public class Snapshot { ? id;
? entries;
}
public class Entry { ? key;
? values;
? next;
? previous;
}
In order to obtain full marks, your program will be checked against automatic test cases, manually inspected by your tutors and you must submit a set of test cases that ensure you have implemented functionality correctly. You will be required to attend a feedback session during your allocated tutorial on the 4th of February.
s im p l e
s ke l e t o n c la s s e s
a nd
hin t s on ho w to
im p l e m e n t
y o u r
INFO1113
Page 2 of 9

Commands
Your program should implement the following commands, look at the examples to see how they work.
• If a does not exist in the current state, output: no such key
• If a does not exist in the database, output: no such snapshot • If an does not exist in an entry, output: index out of range
BYE HELP
LIST LIST LIST
GET
DEL deletes entry from current state
PURGE deletes entry from current state and snapshots
SET sets entry values
PUSH pushes values to the front
clear database and exit displa y this help message
KEYS displa ys all ENTRI E S displa ys SNAP S H O T S disp la y s
displa ys entry values
APPEND
appends values to the back value at index
PICK
displa ys displa ys
PLUCK POP
displa ys
and and removes
remove s the front
value at index value
keys in current state
all a ll
entrie s in current sna ps h o t s in the
state
da ta ba s e
INFO1113
DROP
ROLL B AC K
replaces current state with a copy of snapshot SNAPSHOT as a snapshot
MIN displa ys minimum value MAX displays maximum value SUM displa ys sum of values
delete s
restore s to snapsho t and
snaps hot
LEN
REV
UNIQ
SORT
DIFF displays set difference of values in keys INTER displays set intersection of values in keys UNION displays set union of values in keys
> BYE bye

displa ys
number of values order of values

reverse s
removes
sorts values in ascendin g order
repeate d
adjace nt values
delete s newer
snapsho ts
saves the current state
CHE CKO UT
Page 3 of 9

Examples (1)
> LIST KEYS
no keys > SET a 1 ok
> LIST ENTRIES
no entries > SET b 2 3 ok
> LIST SNAPSHOTS
no snapshots > LIST KEYS b
a
> SET a 1 ok
> GET a [1]
> POP a 1
> GET a []
> POP a nil
>PUSH a21 ok
> GET a [1 2]
>APPEND a34 ok
> GET a [1 2 3 4]
> DEL a ok
> DEL a
no such key
> BYE bye
INFO1113
Page 4 of 9

Examples (2)
> SET a 1 ok
> SET b 2 3 ok
> b a
> b a
> no
LIST KEYS
LIST ENTRIES [2 3]
[1]
LIST SNAPSHOTS snapsho ts
>PICK a0
index out of range
>PICK b1 2
> GET b [2 3]
> PLUCK 3
> GET b [2]
> DEL b ok
> GET b
no such key
> PURGE b ok
> BYE bye
b 2
INFO1113
Page 5 of 9

Examples (3)
> DROP 1
no such snapsho t
> ROLLBACK 1 no such snapsho t
> SET a 1 2 ok
> SET b 3 4 ok
> LIST ENTRIES b [3 4]
a [1 2]
> SNAPSHOT
saved as snapsho t 1
> SET c 5 6 ok
> LIST ENTRIES c [5 6] b
[3 4]a [1
2]
> SNAPSHOT
saved as snapsho t 2
> PURGE b ok
> ROLLBACK 1 ok
> CHECKOUT 2 no such snapsho t
> a
> 1
LIST ENTRIES [1 2]
LIST SNAPSHOTS
> bye
BYE
INFO1113
Page 6 of 9

Examples (4)
>SET a142342ok
> SNAPSHOT
saved as snapsho t 1
> MIN a 1
> MAX a 4
> SUM a 16
> LEN a 6
> REV a ok
> GET a
[2 4 3 2 4 1]
> SORT a ok
> GET a
[1 2 2 3 4 4]
> UNIQ a ok
> GET a [1 2 3 4]
> 1
> 1
> a
CHECKOUT ok
LIST SNAPSHOTS
LIST ENTRIES [1 4 2 3 4 2]
> bye
BYE
INFO1113
Page 7 of 9

Writing your own testcases
We have provided you with some test cases but these do not not test all the functionality described in the assignment. It is important that you thoroughly test your code by writing your own test cases.
You should place all of your test cases in the tests/ directory. Ensure that each test case has the .in input file along with a corresponding .out output file. We require that the names of your test cases are descriptive so that you know what each is testing, e.g. get-set.in and sort-uniq.in and we can accurately and quickly assess your test cases.
Submission Details
Your attendance on Monday 4th February, tutorial is required to receive feedback on your assign- ment progress. Final deliverable for the correctness and manual inspection will be due on the 9th of February 2019.
You must submit your code and tests using the assignment page on Ed. To submit, simply place your files and folders into the workspace, click run to check your program works and then click submit.
You are encouraged to submit multiple times, but only your last submission will be considered.
Marking
You will only be given valid inputs as part of the automatic test suite. Your program will be checked for errors that a user can possibly make. In addition, we will mark your program against a substantial collection of hidden test cases.
5 marks are assigned based on automatic tests for the correctness of your program. This component will use hidden test cases that cover every aspect of the specification. Your program must match the exact output in the examples and the test cases on Ed.
6 marks are assigned based on a manual inspection of the style (1 mark), application design (2 marks) and tests cases (3 marks). Make sure that you carefully follow the assignment specifications and thoroughly test your code, optimising for coverage and testing for a variety of input ranges.
1 mark is assigned on attendance on the 4th of February lab for feedback and progress update. Your tutor will inspect your code, provide feedback and critique your current progress. Please aim to have made a substantial attempt on the assignment to optimise the feedback your tutor can provide you.
INFO1113
Page 8 of 9

Academic declaration
By submitting this assignment you declare the following:
I declare that I have read and understood the University of Sydney Student Plagiarism: Coursework Policy and Procedure, and except where specifically acknowledged, the work contained in this assignment/project is my own work, and has not been copied from other sources or been previously submitted for award or assessment.
I understand that failure to comply with the Student Plagiarism: Coursework Policy and Procedure can lead to severe penalties as outlined under Chapter 8 of the University of Sydney By-Law 1999 (as amended). These penalties may be imposed in cases where any significant portion of my submitted work has been copied without proper acknowledgment from other sources, including published works, the Internet, existing programs, the work of other studen ts, or work previously submitted for other award s or assess men ts.
I realise that I may be asked to identify those portions of the work contributed by me and required to demonstrate my knowledge of the relevant material by answering oral questions or by undertaking supplementary work, either written or in the laboratory, in order to arrive at the final assessment mark.
I acknowledge that the School of Information Technologies, in assessing this assignment, may reproduce it entirely, may provide a copy to another member of faculty, and/or communicate a copy of this assignment to a plagiarism checking service or in-house computer program, and that a copy of the assignment may be maintained by the service or the School of IT for the purpose of future plagiarism checking.
INFO1113
Page 9 of 9