int index = geometryIndex + 1;
int index = geometryIndex;
	private int parseCoordinateList(String wktGeometry, StringTokenizer st,		int geometryIndex, boolean isMultiPoint)		throws MapyrusException	{		String token;		boolean foundOpenParen, foundCloseParen, foundEmpty;		boolean foundX, foundY;		int index = geometryIndex + 1;		int counter = 0;		/*		 * First expect a '(' or the keyword 'EMPTY'.		 */		foundOpenParen = foundCloseParen = foundEmpty = false;		while (foundOpenParen == false && foundEmpty == false			&& st.hasMoreTokens())		{			token = st.nextToken();			if (token.equals("("))				foundOpenParen = true;			else if (token.equals("EMPTY"))				foundEmpty = true;		}		/*		 * Then expect a series of X and Y coordinate value separated by commas,		 * and then a ')' to finish the coordinate string.		 */		if (foundOpenParen)		{			foundX = foundY = false;			while (foundCloseParen == false && st.hasMoreTokens())			{				token = st.nextToken();				char c = token.charAt(0);				if (Character.isDigit(c) || c == '-' || c == '.')				{					try					{						if (foundX == false)						{							if (isMultiPoint)							{								/*								 * Set each point in multipoint geometry as								 * a separate point geometry.								 */								mGeometryValue[index] = GEOMETRY_POINT;								mGeometryValue[index + 1] = 1;								mGeometryValue[index + 2] = MOVETO;								index += 3;							}							else if (counter == 0)							{								/*								 * Move to first coordinate pair, then add a								 * line to each subsequent pair.								 */								mGeometryValue[index] = MOVETO;								index++;							}							else							{								mGeometryValue[index] = LINETO;								index++;							}							mGeometryValue[index] = Double.parseDouble(token);							index++;							foundX = true;						}						else if (foundY == false)						{							mGeometryValue[index] = Double.parseDouble(token);							index++;							foundY = true;							counter++;						}						else						{							/*							 * Not expecting an X or Y coordinate.  The OGC string must be invalid.							 */							throw new MapyrusException(MapyrusMessages.get(MapyrusMessages.INVALID_OGC_WKT) +								": " + wktGeometry);						}					}					catch (NumberFormatException e)					{						throw new MapyrusException(MapyrusMessages.get(MapyrusMessages.INVALID_OGC_WKT) +							": " + wktGeometry);					}				}				else if (c == ')' && foundY)				{					/*					 * Found closing parenthesis marking end of coordinates.					 */					foundCloseParen = true;				}				else if (c == ',' && foundY)				{					/*					 * Found comma separating coordinate pairs					 */					foundX = foundY = false;				}				else if (c != ' ')				{					throw new MapyrusException(MapyrusMessages.get(MapyrusMessages.INVALID_OGC_WKT) +						": " + wktGeometry);				}			}		}		/*		 * Did we successively parse something?		 */		if (foundOpenParen && foundCloseParen == false)		{			throw new MapyrusException(MapyrusMessages.get(MapyrusMessages.INVALID_OGC_WKT) +				": " + wktGeometry);		}		/*		 * Set number of coordinate pairs in geometry.		 */		mGeometryValue[geometryIndex] = counter;		return(index);	}