Netbeans/java computer science Question help please!!!!!!!!!?

Netbeans/java computer science Question help please!!!!!!!!!?

Design a class, named TokenCheck, that checks if a String is made of tokens of the same data type ( you only need to consider the primitive data types: boolean, char, double, or int ).

This class has three instance variables:

- the String of data

- the delimiter for the String

- token type ( boolean, char, double, int, mixed, or unknown )

Two constructors:

- a default constructor that creates an object with an empty String, no specified delimiter, and unknown for the token type.

- an overload constructor that has a String and a delimiter as parameters that creates an object with String and delimiter set to the parameter values and token type set to its appropriate value.


- checkTokens:

o takes one parameter representing the data type expected

o the method returns true if all the tokens in the String are of the specified data type, otherwise returns false

- determineTokenType:

o determines the token type for the String

o sets the token type instance variable to the appropriate value

- get & set methods for the instance variables as appropriate:

o think carefully on these methods

o they should not allow you to end up with an object in an inconsistent state.

o e.g. should you be able to set the String without setting the delimiter?

o Should you be able to set the value of token type?

o Should you be able to have an instance of an object that has a none empty String, a defined delimiter, but no token type specified?

- toString:

o returns the contents an instance of the class

- equals:

o returns a true if true if two instances of the TokenCheck class have the same values for all instance variables, otherwise returns false


Step 1:

Your client file will read in a list of String-delimiter pairs from a text file.

The name of the input file should be entered into a JOptionPane input box. If the user enters an incorrect filename then an appropriate message should be displayed in a JOptingPane message block and the user should be given the opportunity to enter another filename. This process should continue until the user enters a valid input file name.

In the data file each String will be on a single line and its corresponding delimiter will be on the next line.

Your client will create an instance of the TokenCheck class for each String-delimiter pair that it reads in. The instances must be stored in an ArrayList.

Step 2:

Your client should manually create two additional instances of the TokenCheck class. One instance should demonstrate the default constructor and the set methods. The other instance should demonstrate the overload constructor. The values for the parameters may be hard coded into your client, your client does not have to ask the user to input the values of the parameters. These two instances should also be stored in the ArrayList.

Step 3:

Your client should sort the contents of the ArrayList so that instances of TokenCheck are sorted alphabetically first by the token type and then by the String. For example all of the Strings of boolean token type should be listed first and within this set the instances should be sorted alphabetically by the String. If you want you can write the sort code in the Client. You are not required to create a separate Class to do the sorting.

Step 4:

Your client should print out the contents of the sorted ArrayList using the toString method.

Step 5:

Your client should write the contents of the ArrayList to two separate files.

- For the first file write contents of the sorted ArrayList as objects to a file named home06objects.

- For the second file write the contents of the sorted ArrayList to a text file named home06.txt. Each instance of TokenCheck should be written to the text file as three separate lines:

o The String

o The delimiter

o The token type

if someone could send me the coding that would help me so much with the amount of school work I have..

No Answers Posted Yet.