<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.christophchamp.com/index.php?action=history&amp;feed=atom&amp;title=GeSHi%2FJava</id>
		<title>GeSHi/Java - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.christophchamp.com/index.php?action=history&amp;feed=atom&amp;title=GeSHi%2FJava"/>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=GeSHi/Java&amp;action=history"/>
		<updated>2026-05-23T12:50:33Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://wiki.christophchamp.com/index.php?title=GeSHi/Java&amp;diff=1320&amp;oldid=prev</id>
		<title>Christoph at 17:32, 17 December 2005</title>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=GeSHi/Java&amp;diff=1320&amp;oldid=prev"/>
				<updated>2005-12-17T17:32:34Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:32, 17 December 2005&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot; &gt;Line 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; * NOTE: The interaction is entirely from the command prompt!&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; * NOTE: The interaction is entirely from the command prompt!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; * @author Christoph Champ &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(s051307)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; * @author Christoph Champ&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Christoph</name></author>	</entry>

	<entry>
		<id>http://wiki.christophchamp.com/index.php?title=GeSHi/Java&amp;diff=1319&amp;oldid=prev</id>
		<title>Christoph: Added &quot;FlightSystemUser.java&quot; as a test</title>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=GeSHi/Java&amp;diff=1319&amp;oldid=prev"/>
				<updated>2005-12-17T17:32:04Z</updated>
		
		<summary type="html">&lt;p&gt;Added &amp;quot;FlightSystemUser.java&amp;quot; as a test&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;java&amp;gt;&lt;br /&gt;
package flightSystem;&lt;br /&gt;
&lt;br /&gt;
import java.io.*;&lt;br /&gt;
import java.util.*;&lt;br /&gt;
&lt;br /&gt;
import commandObjects.CancelObject;&lt;br /&gt;
import commandObjects.CreateObject;&lt;br /&gt;
import commandObjects.ExitObject;&lt;br /&gt;
import commandObjects.FlightsObject;&lt;br /&gt;
import commandObjects.IdentifyObject;&lt;br /&gt;
import commandObjects.ListObject;&lt;br /&gt;
import commandObjects.ReloadObject;&lt;br /&gt;
import commandObjects.ReserveObject;&lt;br /&gt;
import commandObjects.StoreObject;&lt;br /&gt;
import exceptions.*;&lt;br /&gt;
&lt;br /&gt;
/** &lt;br /&gt;
 * This is the MAIN() class!&lt;br /&gt;
 * &lt;br /&gt;
 * It provides access to all the data structures generated/created&lt;br /&gt;
 * and provides the user with a way to interact with the application.&lt;br /&gt;
 * &lt;br /&gt;
 * NOTE: The interaction is entirely from the command prompt!&lt;br /&gt;
&lt;br /&gt;
 * @author Christoph Champ (s051307)&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
public class FlightSystemUser {&lt;br /&gt;
&lt;br /&gt;
	// Constructors&lt;br /&gt;
	// No arg Constructor&lt;br /&gt;
	public FlightSystemUser() {}&lt;br /&gt;
&lt;br /&gt;
	// Other Methods&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method that tokenizes the command argument line introduced by the &lt;br /&gt;
	 * user and executes the corresponding method.&lt;br /&gt;
	 * @param line&lt;br /&gt;
	 * The line introduced by the user&lt;br /&gt;
	 * @param in&lt;br /&gt;
	 * The buffered reader from where the line was read&lt;br /&gt;
	 * @throws ExpIllegalCommand&lt;br /&gt;
	 * The syntax of the command introduced by the user is not correct&lt;br /&gt;
	 * @throws ExpFlightNotExist&lt;br /&gt;
	 * The flight name inserted by the user does not exist&lt;br /&gt;
	 * @throws ExpIllegalValues&lt;br /&gt;
	 * The values inserted by the user are not correct.&lt;br /&gt;
	 * @throws ExpSeatsFull&lt;br /&gt;
	 * There are no so many seats available&lt;br /&gt;
	 * @throws ExpReserveNotExist&lt;br /&gt;
	 * The booking number inserted by the user does not identify&lt;br /&gt;
	 * any reservation&lt;br /&gt;
	 */&lt;br /&gt;
	public void exec(String line, BufferedReader in) &lt;br /&gt;
		throws ExpIllegalCommand, ExpIllegalValues, ExpFlightNotExist,&lt;br /&gt;
		ExpReserveNotExist, ExpSeatsFull, ExpFlightExists&lt;br /&gt;
	{&lt;br /&gt;
	    // Tokenize the line read&lt;br /&gt;
		StringTokenizer st = new StringTokenizer(line);&lt;br /&gt;
		if ( st.hasMoreTokens() ) {&lt;br /&gt;
		    // Get the first token, which identifies the command&lt;br /&gt;
		    // to be executed&lt;br /&gt;
			String command = new String(st.nextToken().toLowerCase());&lt;br /&gt;
			// Execute the right command depending on the data.&lt;br /&gt;
			if (command.equals(&amp;quot;create&amp;quot;))&lt;br /&gt;
				new CreateObject().parse(st);&lt;br /&gt;
			else if (command.equals(&amp;quot;reserve&amp;quot;))&lt;br /&gt;
				new ReserveObject().parse(st);&lt;br /&gt;
			else if (command.equals(&amp;quot;cancel&amp;quot;))&lt;br /&gt;
				new CancelObject().parse(st);&lt;br /&gt;
			else if (command.equals(&amp;quot;identify&amp;quot;))&lt;br /&gt;
				new IdentifyObject().execute(st);&lt;br /&gt;
			else if (command.equals(&amp;quot;list&amp;quot;))&lt;br /&gt;
				new ListObject().parse(st);&lt;br /&gt;
			else if( command.equals(&amp;quot;flights&amp;quot;) )&lt;br /&gt;
				new FlightsObject().parse();&lt;br /&gt;
			else if( command.equals(&amp;quot;store&amp;quot;) )&lt;br /&gt;
				new StoreObject().parse(st);&lt;br /&gt;
			else if( command.equals(&amp;quot;reload&amp;quot;) )&lt;br /&gt;
				new ReloadObject().parse(st);&lt;br /&gt;
			else if (command.equals(&amp;quot;exit&amp;quot;))&lt;br /&gt;
				new ExitObject().parse(st, in);&lt;br /&gt;
			else&lt;br /&gt;
				System.out.println(&amp;quot;\tUnrecognized command &amp;quot; + line);&lt;br /&gt;
		}&lt;br /&gt;
		else System.out.println(&amp;quot;\tUnrecognized command &amp;quot; + line);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// STDOUT MESSAGES&lt;br /&gt;
	/**&lt;br /&gt;
	 * Displays the commands that the user can execute&lt;br /&gt;
	 */&lt;br /&gt;
	private void available() {&lt;br /&gt;
		System.out.println(&amp;quot;\tPossible Commands:\n&amp;quot;);	&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; create flightName rows rowLength&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; reserve flightName passenger1 [passenger2 .. passengerN]&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; cancel bookingNumber&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; cancel bookingNumber passenger1 [passenger2 .. passengerN]&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; identify bookingNumber&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; list flightName&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; flights&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; store filename&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; reload filename&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t-&amp;gt; exit\n&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Opening introduction to programme&lt;br /&gt;
	 */&lt;br /&gt;
	public void intro() {&lt;br /&gt;
		System.out.println(&amp;quot;\n\t======================================&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t|                                    |&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t| A Simple Flight Reservation System |&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t|                                    |&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t| Authors: Christoph Champ           |&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t| Created: 6 November 2005           |&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t| Subject: 02115 Java Programming    |&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t|                                    |&amp;quot;);&lt;br /&gt;
		System.out.println(&amp;quot;\t======================================\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		available();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * This is the main section of the MAIN() section:&lt;br /&gt;
	 */&lt;br /&gt;
	public static void main(String[] args) {&lt;br /&gt;
	    // The buffered reader from where we will read the data&lt;br /&gt;
	    BufferedReader in;		&lt;br /&gt;
		try {&lt;br /&gt;
			switch (args.length) {&lt;br /&gt;
				// If the number of arguments is 0, the programme&lt;br /&gt;
				// should interact with the user&lt;br /&gt;
				case 0:&lt;br /&gt;
					in = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
					break;&lt;br /&gt;
						&lt;br /&gt;
					// If the number of arguments is 1, the programme should&lt;br /&gt;
					// read the data from a text file&lt;br /&gt;
					case 1:&lt;br /&gt;
						in = new BufferedReader(new FileReader(args[0]));&lt;br /&gt;
						break;&lt;br /&gt;
						&lt;br /&gt;
					// The programme have not been called properly&lt;br /&gt;
					default:&lt;br /&gt;
						throw new ExpInvalidArg(args);&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				// Variable to store each line read&lt;br /&gt;
				String line;&lt;br /&gt;
				// Variable to handle the state of the flight system&lt;br /&gt;
				FlightSystemUser fsu = new FlightSystemUser();&lt;br /&gt;
				&lt;br /&gt;
				// Display the introduction&lt;br /&gt;
				fsu.intro();&lt;br /&gt;
				&lt;br /&gt;
				// While there is data available, process it&lt;br /&gt;
				// Main loop, reads the input, executes the commands, and&lt;br /&gt;
				// displays the output&lt;br /&gt;
				while ( (line = in.readLine()) != null ) {	&lt;br /&gt;
				    // Try to execute the command&lt;br /&gt;
					try	{&lt;br /&gt;
						fsu.exec(line, in);&lt;br /&gt;
					}&lt;br /&gt;
					&lt;br /&gt;
					// Handle illegal command exception&lt;br /&gt;
					catch(ExpIllegalCommand e)	{&lt;br /&gt;
						System.out.println(e);&lt;br /&gt;
					}&lt;br /&gt;
					&lt;br /&gt;
					// Handle illegal values exception&lt;br /&gt;
					catch(ExpIllegalValues e) {&lt;br /&gt;
						System.out.println(e);&lt;br /&gt;
					}&lt;br /&gt;
					&lt;br /&gt;
					// Handle non-existent reservation exception&lt;br /&gt;
					catch(ExpReserveNotExist e) {&lt;br /&gt;
						System.out.println(e);&lt;br /&gt;
					}&lt;br /&gt;
					&lt;br /&gt;
					// Handle illegal command exception&lt;br /&gt;
					catch(ExpFlightNotExist e) {&lt;br /&gt;
						System.out.println(e);&lt;br /&gt;
					}&lt;br /&gt;
					&lt;br /&gt;
					// Handle number format exception&lt;br /&gt;
					catch(NumberFormatException e) {&lt;br /&gt;
						System.out.println(&amp;quot;\tInvalid input value: &amp;quot; + &lt;br /&gt;
								e.getMessage());&lt;br /&gt;
						System.out.println(&amp;quot;\tInteger excepted.&amp;quot;);&lt;br /&gt;
					}&lt;br /&gt;
					&lt;br /&gt;
					// Handle no more seats exception&lt;br /&gt;
					catch(ExpSeatsFull e) {&lt;br /&gt;
					    System.out.println(e);&lt;br /&gt;
					}&lt;br /&gt;
					&lt;br /&gt;
					// Handle that the flight has already been created&lt;br /&gt;
					catch(ExpFlightExists e) {&lt;br /&gt;
					    System.out.println(e);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			&lt;br /&gt;
			// Handle IOException exception&lt;br /&gt;
			catch (IOException e) {&lt;br /&gt;
				System.out.println(&amp;quot;Can't locate file!&amp;quot;);&lt;br /&gt;
			}&lt;br /&gt;
			&lt;br /&gt;
			// Handle invalid arguments exception&lt;br /&gt;
			catch (ExpInvalidArg e) {&lt;br /&gt;
			    System.out.println(e);&lt;br /&gt;
			}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christoph</name></author>	</entry>

	</feed>