src/org/ohmage/domain/campaign/RepeatableSetResponse.java
public void addResponse(
			final int iteration, 
			final int index, 
			final Response response) 
			throws DomainException {
		
		if(response == null) {
			throw new DomainException("The response is null.");
		}
		
		Map<Integer, Response> iterationResponses = responses.get(iteration);
		if(iterationResponses == null) {
			Map<Integer, Response> currResponses = new HashMap<Integer, Response>();
			currResponses.put(index, response);
			
			responses.put(iteration, currResponses);
		}
		else {
			if(iterationResponses.containsKey(index)) {
				throw new DomainException(
						"A response already existed for that index in that iteration.");
			}
			else {
				iterationResponses.put(index, response);
			}
		}
	}
/**
	 * Adds a response to the repeatable set.
	 * 
	 * @param iteration The iteration of the repeatable set.
	 * 
	 * @param index The prompt's index in the repeatable set off which this
	 * 				response was based.
	 * 
	 * @param response The response.
	 * 
	 * @throws DomainException Thrown if the response is null or if a response
	 * 						   already exists for the iteration and index. 
	 */
Adds a response to the repeatable set.

@param iteration The iteration of the repeatable set.

@param index The prompt's index in the repeatable set off which this
response was based.

@param response The response.

@throws DomainException Thrown if the response is null or if a response
already exists for the iteration and index.
Adds a response to the repeatable set . @param iteration The iteration of the repeatable set . @param index The prompt ' s index in the repeatable set off which this response was based . @param response The response . @throws DomainException Thrown if the response is null or if a response already exists for the iteration and index .
public void addResponse(
			final int iteration, 
			final int index, 
			final Response response) 
			throws DomainException {
		if(response == null) {
			throw new DomainException("The response is null.");
		}
		Map<Integer, Response> iterationResponses = responses.get(iteration);
		if(iterationResponses == null) {
			Map<Integer, Response> currResponses = new HashMap<Integer, Response>();
			currResponses.put(index, response);
			responses.put(iteration, currResponses);
		}
		else {
			if(iterationResponses.containsKey(index)) {
				throw new DomainException(
						"A response already existed for that index in that iteration.");
			}
			else {
				iterationResponses.put(index, response);
			}
		}
	}
public void addResponse ( final int iteration , final int index , final Response response ) throws DomainException { if ( response == null ) { throw new DomainException ( "The response is null." ) ; } Map < Integer , Response > iterationResponses = responses . get ( iteration ) ; if ( iterationResponses == null ) { Map < Integer , Response > currResponses = new HashMap < Integer , Response > ( ) ; currResponses . put ( index , response ) ; responses . put ( iteration , currResponses ) ; } else { if ( iterationResponses . containsKey ( index ) ) { throw new DomainException ( "A response already existed for that index in that iteration." ) ; } else { iterationResponses . put ( index , response ) ; } } }
Adds a response to the repeatable set.
Adds a response to the repeatable set .