» JFortune Changelog
- Arraylists are used again but they are used more effeciently this time around.
- jfortune now assigns probability to each file, then gets a random no. and checks that no. against the probabilities assigned and then prints a quote. This means that larger files will have a higher probability for having a quote printed from it.
- You can tell jfortune to consider all files equally when printing out a quote.
- The output mechanism is more modular now with one method being sent all the output. This method knows if the output is to be returned as a string or is to be printed out on the console(or wherever you are running it from).
- jfortune does not use arraylists anymore. Also the handling of the program has been shifted from the main method in jfortuneclass.java to a new method called run in jfortuneclass.java. Also a new class getOpts.java has been added to analyse the command line options.
- jfortune now has the ability to take in options, analyse them and then display output accordingly.
- The .num files are now created by a saperate program called jstrfile. This needs to be called saperately.
- jfortune now uses jar files to execute the programs(you will need JRE version 1.2+ atleast).
- I have cleaned up on some of the code(atleast thats what i think).
- The major change in this series is that jfortune now uses a much more effecient and faster quote fetching algorithm than before.(for those who are interested, I am not deleting the commented out lines so they can see the difference).This should make getting the quotes faster...in theory atleast but i dont think people will notice this unless they run this program on really big and lots of files.
- When you run jfortune for the first time now, the file name is printed out along with the message telling you that you have run jfortune for the first time .
- The way jfortune now works is so:
- Transfers arguments into a arraylist.
- gets a random no.
- fetches the filename parsed in at that no.
- checks if it has a .num file associated with it.
- if it does, a quote is printed out from the file and the program stops.
- if it doesnt, a .num file is created and then the rest of the files are all checked to see if they have associated .num files. if any doesn't, their corresponding .num file is created. However no quotes are printed even if there is a file in the list which has a corresponding .num file to it.
- If you parse a file which is not a file which jfortune recognises as a quotes file, jfortune displays a message saying that the given file is not a quotes file and exits. It does not create a .num file like it did before.However, as stated before, if you keep run jfortune on the same list of files(this will only happen if u provide multiple files), there is a fair possibility that jfortune will display a quote from one of the other files which has a .num file associated with it. The magic of randomness...:).
- null is not printed out when jfortune is run on a file for the first time.
- Commented the source code.
- The jfortune script in the the tarballed file works fien now for the .class files located in /usr/share/jfortune
- jfortune now tells the user to give the whole path to the specified file instead of giving a path relative to the current directory(this has changed in version 0.5 onwards - you can specify any path now.)
- jfortune now acceps multiple files and outputs a fortune cookie from one of these files....again...very randomly.
- Program realises that a fortune cookie format file has not been parsed.
- If you parse the non fortune cookie file...the program scolds you an exits...:).