private final void initializeContexts() {
		Iterator symbolIt = lsystem.getSymbolsWithReplacements().iterator();
		Set searchLengths = new HashSet();
		Integer one = new Integer(1); // It'll be quite common...
		ArrayList contextsList = new ArrayList();
		boolean hasContexts = false;
		// Build the contexts.
		while (symbolIt.hasNext()) {
			String symbol = (String) symbolIt.next();
			List tokens = LSystem.tokenify(symbol);
			List[] replacements = lsystem.getReplacements(symbol);
			int context = 0;
			switch (tokens.size()) {
			case 0:
				// In case they decide to put spaces in. Bleh.
				continue;
			case 1:
				break;
			default: // More than 1 symbol!
				try {
					context = Integer.parseInt((String) tokens.get(0));
					tokens.get(context + 1); // Just to check.
				} catch (NumberFormatException e) {
					// Not a number in the first symbol.
					continue;
				} catch (IndexOutOfBoundsException e) {
					// The number is out of bounds.
					continue;
				}
				hasContexts = true;
				tokens = tokens.subList(1, tokens.size());
			}
			contextsList.add(new Context(tokens, context, replacements));
		}
		// Set the array.
		if (hasContexts)
			contexts = (Context[]) contextsList.toArray(new Context[0]);
	}