class HTMLDataTypeRepresentation {

	static List<String> breakLongLineAtWordBoundaries(String lineStr,
			int maxLineLen) {
		List<String> result = new ArrayList<>();
		StringBuilder lineBuffer = new StringBuilder();

		StringTokenizer tokenizer = new StringTokenizer(lineStr, CHARACTER_SPACE, true);
		while (tokenizer.hasMoreTokens()) {
			String token = tokenizer.nextToken();
			while (!token.isEmpty()) {
				int lineCharsAvail = maxLineLen - lineBuffer.length();
				if (lineCharsAvail < token.length() && token.length() < maxLineLen) {
					result.add(lineBuffer.toString());
					lineBuffer.setLength(0);
					lineCharsAvail = maxLineLen;
				}

				int partLen = Math.min(lineCharsAvail, token.length());
				String part = token.substring(0, partLen);
				lineBuffer.append(part);
				token = token.substring(partLen);

				if (lineBuffer.length() >= maxLineLen) {
					result.add(lineBuffer.toString());
					lineBuffer.setLength(0);
				}
			}
		}
		if (lineBuffer.length() > 0) {
			result.add(lineBuffer.toString());
		}

		return result;
	}

	protected  HTMLDataTypeRepresentation();
	protected  HTMLDataTypeRepresentation(String htmlText);

}