public String getResult() throws InterruptedException, ExecutionException {
		WordProcessingTask task = queue.take().get();

		map.put(task.getCurrentId(), task.getWord());

		if (task.getCurrentId() % ClientServerUtil.BATCH_SIZE == 0) {

			Entry<Long, String> max = Collections.max(map.entrySet(), cmp);
			Entry<Long, String> min = Collections.min(map.entrySet(), cmp);

			int batchNo = (int) task.getCurrentId()
					/ ClientServerUtil.BATCH_SIZE;

			dbManager.insertBatch(batchNo, max.getValue().length() * 100, min
					.getValue().length() * 100, ClientServerUtil
					.getAvarages(map));
			for (Entry<Long, String> entry : map.entrySet()) {
				dbManager.insertWord(entry.getValue(), entry.getValue()
						.length() * 100, parity(entry.getValue()), batchNo);
			}
			map.clear();

		}

		return task.getWord();

	}