private Resource parseText(String lineOfText) {

		boolean done = false; // Indicates the end of parsing
		String token; // String token parsed from the line of text
		int tokenCount = 0; // Number of tokens parsed
		int frontIndex = 0; // Front index or character position
		int backIndex = 0; // Rear index or character position

		// Create a Resource object to record all of the info parsed from
		// the line of text

		Resource resource = new Resource();

		while (!done) {

			backIndex = lineOfText.indexOf(' ', frontIndex);

			if (backIndex == -1) {

				done = true;
				token = lineOfText.substring(frontIndex);

			} else {

				token = lineOfText.substring(frontIndex, backIndex);
			}

			switch (tokenCount) {

			case 0: // Resource ID
				resource.setID(token);
				frontIndex = backIndex + 1;
				tokenCount++;
				break;

			case 1: // Resource's last name
				resource.setLastName(token);
				frontIndex = backIndex + 1;
				tokenCount++;
				break;

			case 2: // Resource's First name
				resource.setFirstName(token);
				frontIndex = backIndex + 1;
				tokenCount++;
				break;

			case 3: // Resource role (see this file's header)
				resource.setRole(token);
				frontIndex = backIndex + 1;
				tokenCount++;
				break;

			default:
				// This is where the projects are added to the list of projects
				// previously assigned to this resource. Note that there are
				// no details other than the project ID.

                if(token != null && !token.isEmpty()) {

                    Project previouslyAssignedProject = projectReader.getListOfProjects().findProjectByID(token);

                    if (previouslyAssignedProject == null) {
                        resource.getPreviouslyAssignedProjectList().addProject(new Project(token));
                    } else {
                        resource.getPreviouslyAssignedProjectList().addProject(previouslyAssignedProject);
                    }
                }

                //resource.getPreviouslyAssignedProjectList().addProject(new Project(token));
				frontIndex = backIndex + 1;
				break;

			} // end switch

		} // end while

		return (resource);

	} // parseText