src/org/ohmage/domain/Location.java
public final void toCsvRow(
			final List<ColumnKey> columns,
			final List<Object> result) 
			throws DomainException {
		
		if(columns == null) {
			throw new DomainException("The list of columns cannot be null.");
		}
		else if(result == null) {
			throw new DomainException("The list of results cannot be null.");
		}
		else if(columns.size() != result.size()) {
			throw new DomainException(
					"The columns list and the result list were different lengths.");
		}
		
		int index;
		
		if((index = columns.indexOf(LocationColumnKey.TIME)) != -1) {
			result.set(index, getTime());
		}
		
		if((index = columns.indexOf(LocationColumnKey.TIMEZONE)) != -1) {
			result.set(index, getTimeZone().getID());
		}
		
		if((index = columns.indexOf(LocationColumnKey.LATITUDE)) != -1) {
			result.set(index, latitude);
		}
		
		if((index = columns.indexOf(LocationColumnKey.LONGITUDE)) != -1) {
			result.set(index, longitude);
		}
		
		if((index = columns.indexOf(LocationColumnKey.ACCURACY)) != -1) {
			result.set(index, accuracy);
		}
		
		if((index = columns.indexOf(LocationColumnKey.PROVIDER)) != -1) {
			result.set(index, provider);
		}
	}
/**
	 * Populates the appropriate indices in the 'result' with values based on
	 * the 'columns'. For example, if the first two columns were not Location
	 * columns, they would be skipped. If the third column was the location's 
	 * latitude, the third index in the 'result' would be populated with this
	 * location's latitude value.
	 * 
	 * @param columns All of the columns in the 'result' list to populate. This
	 * 				  will skip all of those columns that are not 
	 * 				  LocationColumnKey columns.
	 * 
	 * @param result The result list whose values will be updated based on the
	 * 				 'columns'.
	 * 
	 * @throws DomainException The columns or result list was null or had 
	 * 						   differing lengths, or a column was a 
	 * 						   LocationColumnKey column but was unknown to this
	 * 						   function.
	 */
Populates the appropriate indices in the 'result' with values based on
the 'columns'. For example, if the first two columns were not Location
columns, they would be skipped. If the third column was the location's
latitude, the third index in the 'result' would be populated with this
location's latitude value.

@param columns All of the columns in the 'result' list to populate. This
will skip all of those columns that are not
LocationColumnKey columns.

@param result The result list whose values will be updated based on the
'columns'.

@throws DomainException The columns or result list was null or had
differing lengths, or a column was a
LocationColumnKey column but was unknown to this
function.
Populates the appropriate indices in the ' result ' with values based on the ' columns ' . For example if the first two columns were not Location columns they would be skipped . If the third column was the location ' s latitude the third index in the ' result ' would be populated with this location ' s latitude value . @param columns All of the columns in the ' result ' list to populate . This will skip all of those columns that are not LocationColumnKey columns . @param result The result list whose values will be updated based on the ' columns ' . @throws DomainException The columns or result list was null or had differing lengths or a column was a LocationColumnKey column but was unknown to this function .
public final void toCsvRow(
			final List<ColumnKey> columns,
			final List<Object> result) 
			throws DomainException {
		if(columns == null) {
			throw new DomainException("The list of columns cannot be null.");
		}
		else if(result == null) {
			throw new DomainException("The list of results cannot be null.");
		}
		else if(columns.size() != result.size()) {
			throw new DomainException(
					"The columns list and the result list were different lengths.");
		}
		int index;
		if((index = columns.indexOf(LocationColumnKey.TIME)) != -1) {
			result.set(index, getTime());
		}
		if((index = columns.indexOf(LocationColumnKey.TIMEZONE)) != -1) {
			result.set(index, getTimeZone().getID());
		}
		if((index = columns.indexOf(LocationColumnKey.LATITUDE)) != -1) {
			result.set(index, latitude);
		}
		if((index = columns.indexOf(LocationColumnKey.LONGITUDE)) != -1) {
			result.set(index, longitude);
		}
		if((index = columns.indexOf(LocationColumnKey.ACCURACY)) != -1) {
			result.set(index, accuracy);
		}
		if((index = columns.indexOf(LocationColumnKey.PROVIDER)) != -1) {
			result.set(index, provider);
		}
	}
public final void toCsvRow ( final List < ColumnKey > columns , final List < Object > result ) throws DomainException { if ( columns == null ) { throw new DomainException ( "The list of columns cannot be null." ) ; } else if ( result == null ) { throw new DomainException ( "The list of results cannot be null." ) ; } else if ( columns . size ( ) != result . size ( ) ) { throw new DomainException ( "The columns list and the result list were different lengths." ) ; } int index ; if ( ( index = columns . indexOf ( LocationColumnKey . TIME ) ) != - 1 ) { result . set ( index , getTime ( ) ) ; } if ( ( index = columns . indexOf ( LocationColumnKey . TIMEZONE ) ) != - 1 ) { result . set ( index , getTimeZone ( ) . getID ( ) ) ; } if ( ( index = columns . indexOf ( LocationColumnKey . LATITUDE ) ) != - 1 ) { result . set ( index , latitude ) ; } if ( ( index = columns . indexOf ( LocationColumnKey . LONGITUDE ) ) != - 1 ) { result . set ( index , longitude ) ; } if ( ( index = columns . indexOf ( LocationColumnKey . ACCURACY ) ) != - 1 ) { result . set ( index , accuracy ) ; } if ( ( index = columns . indexOf ( LocationColumnKey . PROVIDER ) ) != - 1 ) { result . set ( index , provider ) ; } }
Populates the appropriate indices in the 'result' with values based on
 the 'columns'.
Populates the appropriate indices in the ' result ' with values based on the ' columns ' .