src/org/ohmage/domain/MobilityPoint.java
public final JSONObject toJson(
				final boolean abbreviated,
				final Collection<ColumnKey> columns) 
				throws JSONException, DomainException {
				
			if(columns == null) {
				throw new DomainException(
						"The columns list cannot be null.");
			}
			
			JSONObject result = new JSONObject();
			
			if((columns.contains(MobilityColumnKey.CLASSIFIER_DATA) ||
				columns.contains(ClassifierDataColumnKey.MODE)) &&
				(mode != null)) {
				
				result.put(
					ClassifierDataColumnKey.MODE.toString(abbreviated), 
					mode.name().toLowerCase());
			}
			
			if(columns.contains(MobilityColumnKey.CLASSIFIER_DATA) ||
				columns.contains(ClassifierDataColumnKey.FFT)) {
				
				result.put(
					ClassifierDataColumnKey.FFT.toString(abbreviated), 
					fft);
			}
			
			if(columns.contains(MobilityColumnKey.CLASSIFIER_DATA) ||
				columns.contains(ClassifierDataColumnKey.VARIANCE)) {

				result.put(
					ClassifierDataColumnKey.VARIANCE.toString(abbreviated), 
					variance);
			}
			
			if(columns.contains(MobilityColumnKey.CLASSIFIER_DATA) ||
				columns.contains(ClassifierDataColumnKey.AVERAGE)) {

				result.put(
					ClassifierDataColumnKey.AVERAGE.toString(abbreviated), 
					average);
			}
			
			return result;
		}
/**
		 * Creates a JSONObject that represents the information contained in 
		 * this object.
		 * 
		 * @param abbreviated Whether or not the key should return their 
		 * 					  abbreviated versions or their complete versions.
		 * 
		 * @param columns The columns that should be added to the resulting
		 * 				  JSON.
		 * 
		 * @return A JSONObject representing this object.
		 * 
		 * @throws JSONException There was an error building the JSONObject.
		 */
Creates a JSONObject that represents the information contained in
this object.

@param abbreviated Whether or not the key should return their
abbreviated versions or their complete versions.

@param columns The columns that should be added to the resulting
JSON.

@return A JSONObject representing this object.

@throws JSONException There was an error building the JSONObject.
Creates a JSONObject that represents the information contained in this object . @param abbreviated Whether or not the key should return their abbreviated versions or their complete versions . @param columns The columns that should be added to the resulting JSON . @return A JSONObject representing this object . @throws JSONException There was an error building the JSONObject .
public final JSONObject toJson(
				final boolean abbreviated,
				final Collection<ColumnKey> columns) 
				throws JSONException, DomainException {
			if(columns == null) {
				throw new DomainException(
						"The columns list cannot be null.");
			}
			JSONObject result = new JSONObject();
			if((columns.contains(MobilityColumnKey.CLASSIFIER_DATA) ||
				columns.contains(ClassifierDataColumnKey.MODE)) &&
				(mode != null)) {
				result.put(
					ClassifierDataColumnKey.MODE.toString(abbreviated), 
					mode.name().toLowerCase());
			}
			if(columns.contains(MobilityColumnKey.CLASSIFIER_DATA) ||
				columns.contains(ClassifierDataColumnKey.FFT)) {
				result.put(
					ClassifierDataColumnKey.FFT.toString(abbreviated), 
					fft);
			}
			if(columns.contains(MobilityColumnKey.CLASSIFIER_DATA) ||
				columns.contains(ClassifierDataColumnKey.VARIANCE)) {
				result.put(
					ClassifierDataColumnKey.VARIANCE.toString(abbreviated), 
					variance);
			}
			if(columns.contains(MobilityColumnKey.CLASSIFIER_DATA) ||
				columns.contains(ClassifierDataColumnKey.AVERAGE)) {
				result.put(
					ClassifierDataColumnKey.AVERAGE.toString(abbreviated), 
					average);
			}
			return result;
		}
public final JSONObject toJson ( final boolean abbreviated , final Collection < ColumnKey > columns ) throws JSONException , DomainException { if ( columns == null ) { throw new DomainException ( "The columns list cannot be null." ) ; } JSONObject result = new JSONObject ( ) ; if ( ( columns . contains ( MobilityColumnKey . CLASSIFIER_DATA ) || columns . contains ( ClassifierDataColumnKey . MODE ) ) && ( mode != null ) ) { result . put ( ClassifierDataColumnKey . MODE . toString ( abbreviated ) , mode . name ( ) . toLowerCase ( ) ) ; } if ( columns . contains ( MobilityColumnKey . CLASSIFIER_DATA ) || columns . contains ( ClassifierDataColumnKey . FFT ) ) { result . put ( ClassifierDataColumnKey . FFT . toString ( abbreviated ) , fft ) ; } if ( columns . contains ( MobilityColumnKey . CLASSIFIER_DATA ) || columns . contains ( ClassifierDataColumnKey . VARIANCE ) ) { result . put ( ClassifierDataColumnKey . VARIANCE . toString ( abbreviated ) , variance ) ; } if ( columns . contains ( MobilityColumnKey . CLASSIFIER_DATA ) || columns . contains ( ClassifierDataColumnKey . AVERAGE ) ) { result . put ( ClassifierDataColumnKey . AVERAGE . toString ( abbreviated ) , average ) ; } return result ; }
Creates a JSONObject that represents the information contained in
 this object.
Creates a JSONObject that represents the information contained in this object .