src/org/ohmage/domain/Document.java
public Role addClassRole(String classId, Role role) 
			throws DomainException {
		
		if(classId == null) {
			throw new DomainException(
					ErrorCode.CLASS_INVALID_ID,
					"The class ID is null.");
		}
		else if(role == null) {
			throw new DomainException(
					ErrorCode.CLASS_INVALID_ROLE,
					"The role is null.");
		}

		if(maxRole == null) {
			maxRole = role;
		}
		else if(maxRole.compare(role) == 1) {
			maxRole = role;
		}
		
		return classAndRole.put(classId, role);
	}
/**
	 * Adds a class to the list of classes associated with this document if it
	 * didn't already exist. Then, it associates the document role to the class
	 * for this document. If the class was already associated, the old role is
	 * returned and the new role is stored.
	 * 
	 * @param classId A unique identifier for a class.
	 * 
	 * @param role The role to be associated with this class for this
	 * 			   document.
	 * 
	 * @return The old document role for this class for this user.
	 * 
	 * @throws DomainException Thrown if the class ID or role are null.
	 */
Adds a class to the list of classes associated with this document if it
didn't already exist. Then, it associates the document role to the class
for this document. If the class was already associated, the old role is
returned and the new role is stored.

@param classId A unique identifier for a class.

@param role The role to be associated with this class for this
document.

@return The old document role for this class for this user.

@throws DomainException Thrown if the class ID or role are null.
Adds a class to the list of classes associated with this document if it didn ' t already exist . Then it associates the document role to the class for this document . If the class was already associated the old role is returned and the new role is stored . @param classId A unique identifier for a class . @param role The role to be associated with this class for this document . @return The old document role for this class for this user . @throws DomainException Thrown if the class ID or role are null .
public Role addClassRole(String classId, Role role) 
			throws DomainException {
		if(classId == null) {
			throw new DomainException(
					ErrorCode.CLASS_INVALID_ID,
					"The class ID is null.");
		}
		else if(role == null) {
			throw new DomainException(
					ErrorCode.CLASS_INVALID_ROLE,
					"The role is null.");
		}
		if(maxRole == null) {
			maxRole = role;
		}
		else if(maxRole.compare(role) == 1) {
			maxRole = role;
		}
		return classAndRole.put(classId, role);
	}
public Role addClassRole ( String classId , Role role ) throws DomainException { if ( classId == null ) { throw new DomainException ( ErrorCode . CLASS_INVALID_ID , "The class ID is null." ) ; } else if ( role == null ) { throw new DomainException ( ErrorCode . CLASS_INVALID_ROLE , "The role is null." ) ; } if ( maxRole == null ) { maxRole = role ; } else if ( maxRole . compare ( role ) == 1 ) { maxRole = role ; } return classAndRole . put ( classId , role ) ; }
Adds a class to the list of classes associated with this document if it
 didn't already exist.
Adds a class to the list of classes associated with this document if it didn ' t already exist .