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

Examples of online databases, Examples of Online Databases: The adopti...

Examples of Online Databases: The adoption of modern technology has resulted in the proliferation of machine readable databases. The National Library of Medicine (USA) designe

Data Type Conversion, Sometimes you may drop to perform conversions among t...

Sometimes you may drop to perform conversions among the built-in types. To translate between types you just use the type name as a function. There are quite a few built-in function

Modeling historical data, Given the scenario below, construct a conceptual ...

Given the scenario below, construct a conceptual model. The Seville, Spain soccer association is renovating their soccer arena. They are adding luxury boxes that will be offered to

What is microcontroller?, Microcontroller: A highly integrated microprocess...

Microcontroller: A highly integrated microprocessor designed specifically for use in embedded systems. Microcontrollers typically includes an integrated CPU, memory (a small amount

Purchasing a database program, When purchasing a database program, you must...

When purchasing a database program, you must have a clear idea of what you need it for. Ask yourself the following questions. (1) Will it perform all (he operations necessary f

Explain the components of it infrastructure, Question 1 Explain in detail ...

Question 1 Explain in detail the different modes of Transportation Question 2 State the meaning of Distribution Strategies. Discuss the different Distribution Strategies

The internet or the world wide web, The internet or the World Wide Web is ...

The internet or the World Wide Web is the most familiar and popular example. These databases hold vast amounts of information, for example, on companies. By obtaining details in t

What is packet switching? explain, Question 1 What are the five subscriber...

Question 1 What are the five subscriber-related signaling functions performed by the operator? Question 2 Compare Microprogrammed control and Hard-wired control Que

Assignment, Hi I have an assignment can you help me ?

Hi I have an assignment can you help me ?

Explain what is rmi, QUESTION (a) Explain what is RMI? (b) Draw a di...

QUESTION (a) Explain what is RMI? (b) Draw a diagram showing the different parts of the Java RMI architecture. (c) What is the function of the RMI security manager and RM

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