import java.util.*;

/*
 * The purpose of this class is to take in the raw user input text (the command)
 * and interpret it; then calling the corresponding method with the command.
 */

public class CommandFetch 
{
	//loader: takes the input from the GUI text area as input; removing the line
	//breaks and placing the 'words' into a string array (command). This array is
	//then passed to the interpret method.
	public void loader(String text)
	{
		text = text.replace("\n", "");
		String[] command = text.split(" ");
		
		//DEBUG MESSAGE
		System.out.println(text);
		
		interpret(command);
	}
	
	//interpret: takes the string array and determines which command is being
	//called via the first letter of the command; changing the control integer
	//and then using said integer in a switch statement to call the corresponding
	//calling method.
	public void interpret(String[] commArr)
	{
		int control = 0;
		/*
		 * LIST OF CONTROL VALUES:
		 * 0 = default, return syntax error
		 * 1 = create table
		 * 2 = create intersection table?
		 * 3 = insert
		 * 4 = update
		 * 5 = select
		 */
		
		if (commArr[0].equalsIgnoreCase("CREATE") && commArr[1].equalsIgnoreCase("TABLE"))
		{
			control = 1;
		}
		
		switch(control)
		{
			case 0:
				//error message goes here?
				break;
				
			case 1:
				callCreateTable(commArr);
				break;
				
			default:
				//Syntax error should go here?
				break;
		}
		
	}
	
	//callCreateTable: takes the command string array as a parameter; gets the
	//table name, and puts the data types (in string format) in one arraylist, and 
	//the field (column) names in another. Finally, it will call the create table
	//command, passing the table name and the two arraylists as parameters.
	public void callCreateTable(String[] command)
	{
		String tableName = command[2];
		
		if (tableName.contains("("))
		{
			String[] s = tableName.split("\\(");
			tableName = s[0];
		}
		
		//DEBUG MESSAGE
		System.out.println(tableName);
		
		ArrayList<String> dataTypes;
		ArrayList<String> colNames;
	}
}

@@ -209,16 +209,46 @@
 etch %0A%7B%0A
+%09public String fullCommand;%0A%09%0A
 %09//loade
@@ -505,16 +505,38 @@
 %22, %22%22);%0A
+%09%09fullCommand = text;%0A
 %09%09String
@@ -607,20 +607,27 @@
 println(
-text
+fullCommand
 );%0A%09%09%0A%09%09
@@ -1860,24 +1860,103 @@
 mand%5B2%5D;%0A%09%09%0A
+%09%09String data = fullCommand.split(%22%5C%5C(%22)%5B1%5D;%0A%09%09data = data.split(%22%5C%5C)%22)%5B0%5D;%0A%09%09%0A
 %09%09if (tableN
@@ -1970,24 +1970,24 @@
 tains(%22(%22))%0A
-
 %09%09%7B%0A%09%09%09Strin
@@ -2056,32 +2056,60 @@
 //DEBUG MESSAGE%0A
+%09%09System.out.println(data);%0A
 %09%09System.out.pri
@@ -2152,50 +2152,462 @@
 ng%3E 
-dataTypes;%0A%09%09ArrayList%3CString%3E colNames
+colNames = new ArrayList%3CString%3E();%0A%09%09ArrayList%3CString%3E dataTypes = new ArrayList%3CString%3E();%0A%09%09%0A%09%09String dataArr%5B%5D = data.split(%22,%22);%0A%09%09%0A%09%09for (int i = 0; i %3C dataArr.length; i++)%0A%09%09%7B%0A%09%09%09String tempArr%5B%5D = dataArr%5Bi%5D.split(%22 %22);%0A%09%09%09colNames.add(tempArr%5B0%5D);%0A%09%09%09dataTypes.add(tempArr%5B1%5D);%0A%09%09%7D%0A%09%09%0A%09%09//AND THEN I JUST PASS THE TWO ARRAYLISTS TO THE CREATE TABLE METHOD%0A%09%09%0A%09%09//DEBUG MESSAGE%0A%09%09System.out.println(colNames);%0A%09%09System.out.println(dataTypes)
 ;%0A%09%7D%0A
-
 %7D%0A
+%0A

Correct updated commandfetch