icegem-core/src/main/java/com/googlecode/icegem/query/bucketoriented/BucketOrientedQueryService.java
private static int extractLimit(String queryString) {
	int limitIndex = queryString.lastIndexOf("limit");

	if (limitIndex == -1) {
	    limitIndex = queryString.lastIndexOf("LIMIT");
	}

	if (limitIndex == -1) {
	    return limitIndex;
	}

	String limitValue = queryString.substring(limitIndex + 5);

	return Integer.parseInt(limitValue.trim());
    }
private static int extractLimit(String queryString) {
	int limitIndex = queryString.lastIndexOf("limit");

	if (limitIndex == -1) {
	    limitIndex = queryString.lastIndexOf("LIMIT");
	}

	if (limitIndex == -1) {
	    return limitIndex;
	}

	String limitValue = queryString.substring(limitIndex + 5);

	return Integer.parseInt(limitValue.trim());
    }
Extracts limit value from query string.

@param queryString OQL query string.
@return Value of 'limit' clause.