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

Generic techniques in artificial intelligence, G e ne ric Techniques Dev...

G e ne ric Techniques Developed: In  the  pursuit  of  solutions  to  many   problems  in  the  above  categories,  serval specific  techniques have sprung up which have bee

Digital transmission, Digital Transmission: In digital transmission, w...

Digital Transmission: In digital transmission, wave patterns are translated into discrete bits and are separated by intervals. Bits (contraction for binary digits) are the sma

Online searching, Online Searching: The real difference between manual...

Online Searching: The real difference between manual searching and online searching lies, according to William A. Katz, in the mechanics and the jargon of the latter. However,

What is Assembly Language?, Assembly language is fundamentally the local la...

Assembly language is fundamentally the local language of your computer. In principle the processor of your machine understands machine code (consisting of ones and zeroes). But wit

Artificial intelligence research, Artificial Intelligence research: Art...

Artificial Intelligence research: Artificial Intelligence research may be describe  in terms of how the following question has been answered: "How are we going to get a comp

Utility , what are the definition?

what are the definition?

Immediate addressing, These addressing modes are: With immediate addressing...

These addressing modes are: With immediate addressing, no lookup of data is essentially required. The data is located in the operands of the instruction itself, not in a different

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