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

Where data could be hidden, QUESTION (a) Being just employed as junior ...

QUESTION (a) Being just employed as junior forensic examiner at SAI computer forensic Ltd, your supervisor told you, ‘hey Moona Tambi, we have received a hard disk for examinat

Excell, grades computation

grades computation

Types of computer, types of computer on the basis of shape, size & resource...

types of computer on the basis of shape, size & resources

College management system project, E-R diagram and details for college mana...

E-R diagram and details for college management system

flow chart for online placement, Create systems flow chart and state trani...

Create systems flow chart and state tranistion diagram for online placement and consultancy

Describe CPU registers , The CPU has four internal registers, each of 16 bi...

The CPU has four internal registers, each of 16 bits. The first four, AX, BX, CX, and DX are common use registers and can also be used as 8 bit registers, if used in such a way it

Designing computer based system-systems life cycle approach, Systems Life C...

Systems Life Cycle Approach Systems Analysis and Design follows a life cycle for development, as shown below. Brief discussion on this approach is given here: Figure

Word processing (wp), Word Processing (WP): Word Processing is one of ...

Word Processing (WP): Word Processing is one of the most widespread application software types in use today. Developed as a successor to primitive text editors that were popul

Perverse software, is u given is enough for us for this - what is pervere ...

is u given is enough for us for this - what is pervere software and explain in detail?

Widening web, The Widening Web The idea, the whole world is agog...

The Widening Web The idea, the whole world is agog now had accidental origins. Here is how it all began. In early 1969, the U.S. Defence department financed a network fo

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