Java - Stack and Queue, Basic Computer Science

Assignment Help:
Consider a class called Configuration. This class “encapsulates” the configuration management
for any software system. For example, once created, the user can simply ask the configuration
object for value(s) to a certain configuration key. Let’s take a look at a few examples:
String filename = “config.txt”;
Configuration config = new Configuration( new File(filename) );
int numUser = config.getInteger( “num_users” );
String name = config.getString( “player1” );
In the above example, the config object is constructed and its contents are expressed in the file
config.txt. The format of the config.txt file is as followed.
key = value
key2 = value2
## lines with comments begins with the #
The complete Configuration class should implement the following methods:
Class Configuration {
// constructors
Configuration() { … }
Configuration( File file) { … }
Configuration(String filename) { … }
// accessors
int getSize() { … }
String getString( String key ) { … }
int getInteger( String key ) { … }
String[] getKeys() { … } // return all keys
// mutators
void push(String key, String value) { }
String[] pop() { } // returns String array[] = { key, value }
}
Your Configuration class will have two sub classes: (1) ConfigurationQueue and (2)
ConfigurationStack. The push and pop functions will behave differently depending on whether
your class is a Queue or a Stack.
Your App class is given and you should not change this class at all. Your homework will require
creating three files: Configuration.java ConfigurationQueue.java and ConfigurationStack.java.

Related Discussions:- Java - Stack and Queue

Use triggers to maintain referential integrity, At times, Brewbean''s has c...

At times, Brewbean''s has changed the id number for existing products. In the past, they have had to add a new product row with the new id to the BB_PRODUCT table, modify all the c

Technology partnerships, Technology Partnerships: Such agreements prov...

Technology Partnerships: Such agreements provide the consumer un-limited access to vendor's technology. Such contracts are typically multi-year in nature where the consumer pa

What is Load and store the assembly programs?, It would not emerge practica...

It would not emerge practical to type an entire program each time it is required, and to avoid this it is possible to store a program on the disk, with the vast advantage that by b

#algorithm, #to determine whether given year is leap year or not

#to determine whether given year is leap year or not

C programming program, I wrote a program that adds up 5x5 matrices by colum...

I wrote a program that adds up 5x5 matrices by column and row. Now i have to use pointers to rewrite the same code how would do that

Computers, Computers One of the most  important invention in the desig...

Computers One of the most  important invention in the design of digital  circuits  is that  of the general- purpose "stored program" computer or device. Computers are a partic

Multithreaded Programming in python, Running more than a few threads is lik...

Running more than a few threads is like running several different programs at the same time as, but with the following profits: • Multiple threads inside a process share the same d

What are the uses of the internet, Question 1 What are many of the modern ...

Question 1 What are many of the modern browsers in use today? Describe all in detail Question 2 Write a long note on the uses of Domain Names Question 3 What are the use

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd