src/org/ohmage/service/ClassServices.java
public Set<String> classIdSearch(
			final String partialClassId,
			final String partialClassName,
			final String partialClassDescription)
			throws ServiceException {
		
		try {
			Set<String> result = null;
			
			if(partialClassId != null) {
				result = new HashSet<String>(
						classQueries.getClassIdsFromPartialId(partialClassId));
			}
			
			if(partialClassName != null) {
				List<String> classIds = 
					classQueries.getClassIdsFromPartialName(partialClassName);
				
				if(result == null) {
					result = new HashSet<String>(classIds);
				}
				else {
					result.retainAll(classIds);
				}
			}
			
			if(partialClassDescription != null) {
				List<String> classIds =
					classQueries.getClassIdsFromPartialDescription(partialClassDescription);
				
				if(result == null) {
					result = new HashSet<String>(classIds);
				}
				else {
					result.retainAll(classIds);
				}
			}
			
			// If all of the parameters were null.
			if(result == null) {
				result = new HashSet<String>(classQueries.getAllClassIds());
			}
			
			return result;
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Searches for all class IDs that match the given parameters. The 
	 * base-case is all class IDs. For each parameter, the result is trimmed to
	 * only those classes that match the parameter.<br />
	 * <br />
	 * For example, if all classes in the system were:
	 * <li>urn:class:one, Class One Name, Class one description.</li>
	 * <li>urn:class:one, Class Two Name, Class two description.</li>
	 * If this call had no parameters, then both URN IDs would be returned. If
	 * the ID parameter was "urn:" and the name parameter was "One", then only
	 * the first URN ID, "urn:class:one" would be returned. If the ID parameter
	 * was "urn:" and the name parameter was "one", then an empty set would be
	 * returned because the "o" in "one" was not capitalized. Finally, if only
	 * the name parameter was given and it was "One", then exactly one result
	 * would be returned, "urn:class:one".
	 *  
	 * @param partialClassId A partial class ID to compare with all other class
	 * 						 IDs and limit the results to only those that 
	 * 						 contain this value.
	 * 
	 * @param partialClassName A partial class name to compare with all other
	 * 						   class names and limit the results to only those
	 * 						   that contain this value.
	 * 
	 * @param partialClassDescription A partial class description to compare
	 * 								  with all other class descriptions and 
	 * 								  limit the results to only those that
	 * 								  contain this value.
	 * 
	 * @return A, possibly empty but never null, set of class IDs.
	 * 
	 * @throws ServiceException Thrown if there is an error.
	 */
Searches for all class IDs that match the given parameters. The
base-case is all class IDs.

@param partialClassId A partial class ID to compare with all other class
IDs and limit the results to only those that
contain this value.

@param partialClassName A partial class name to compare with all other
class names and limit the results to only those
that contain this value.

@param partialClassDescription A partial class description to compare
with all other class descriptions and
limit the results to only those that
contain this value.

@return A, possibly empty but never null, set of class IDs.

@throws ServiceException Thrown if there is an error.
Searches for all class IDs that match the given parameters . The base - case is all class IDs . @param partialClassId A partial class ID to compare with all other class IDs and limit the results to only those that contain this value . @param partialClassName A partial class name to compare with all other class names and limit the results to only those that contain this value . @param partialClassDescription A partial class description to compare with all other class descriptions and limit the results to only those that contain this value . @return A possibly empty but never null set of class IDs . @throws ServiceException Thrown if there is an error .
public Set<String> classIdSearch(
			final String partialClassId,
			final String partialClassName,
			final String partialClassDescription)
			throws ServiceException {
		try {
			Set<String> result = null;
			if(partialClassId != null) {
				result = new HashSet<String>(
						classQueries.getClassIdsFromPartialId(partialClassId));
			}
			if(partialClassName != null) {
				List<String> classIds = 
					classQueries.getClassIdsFromPartialName(partialClassName);
				if(result == null) {
					result = new HashSet<String>(classIds);
				}
				else {
					result.retainAll(classIds);
				}
			}
			if(partialClassDescription != null) {
				List<String> classIds =
					classQueries.getClassIdsFromPartialDescription(partialClassDescription);
				if(result == null) {
					result = new HashSet<String>(classIds);
				}
				else {
					result.retainAll(classIds);
				}
			}
			if(result == null) {
				result = new HashSet<String>(classQueries.getAllClassIds());
			}
			return result;
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public Set < String > classIdSearch ( final String partialClassId , final String partialClassName , final String partialClassDescription ) throws ServiceException { try { Set < String > result = null ; if ( partialClassId != null ) { result = new HashSet < String > ( classQueries . getClassIdsFromPartialId ( partialClassId ) ) ; } if ( partialClassName != null ) { List < String > classIds = classQueries . getClassIdsFromPartialName ( partialClassName ) ; if ( result == null ) { result = new HashSet < String > ( classIds ) ; } else { result . retainAll ( classIds ) ; } } if ( partialClassDescription != null ) { List < String > classIds = classQueries . getClassIdsFromPartialDescription ( partialClassDescription ) ; if ( result == null ) { result = new HashSet < String > ( classIds ) ; } else { result . retainAll ( classIds ) ; } } if ( result == null ) { result = new HashSet < String > ( classQueries . getAllClassIds ( ) ) ; } return result ; } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Searches for all class IDs that match the given parameters.
Searches for all class IDs that match the given parameters .
// If all of the parameters were null.