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

Unix Shell, Write a shell script, change-lines, which will substitute a str...

Write a shell script, change-lines, which will substitute a string for a replacement string for each occurance of the string in files specified. The original file will be saved,

Objectives of laboratory organisation and management, Objectives When y...

Objectives When you have completed all the work in this unit you should be able to: List the basic components of a personal computer system, 1. describe the use of comput

Evolution of erp , Evolution of ERP  The origin of using computers for ...

Evolution of ERP  The origin of using computers for business, traces the following line of story. Originally, they were designed to support the repetitive and time consuming fu

Twisted pair cable, what are daily uses of twisted pair cable in network

what are daily uses of twisted pair cable in network

Fundamental of algorithm, exchanging the two variables: problem,algorithm d...

exchanging the two variables: problem,algorithm development,discription

Understanding human intelligence in social, Understanding human intelligenc...

Understanding human intelligence in social AI can be taken as just the current tool in the philosopher's toolbox for answering of questions for the behaviour of human intellig

What is the benefit of Threads?, Following are some causes why we use threa...

Following are some causes why we use threads in designing operating systems. A process with several threads makes a great server for instance printer server. For the reason that t

Ms word, what is ms words in parts ms words in life?

what is ms words in parts ms words in life?

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