Code example for Vector

Methods: addElement, contains

0
 
	/* (non-Javadoc) 
	 * @see eu.planets_project.tb.api.model.ExperimentApproval#addApprovalUser(eu.planets_project.tb.api.model.User) 
	 */ 
	public void addApprovalUser(String userID) {
		if(!this.vApprovalUsers.contains(userID)){
			this.vApprovalUsers.addElement(userID);
		} 
 
		//approval required roles were added 
		/*if (this.vReqRoles.size()>0){ 
			Vector<Integer> vUserRoleIDs = user.getRolesIDs(); 
			Iterator<Integer> itUserRoleIDs = vUserRoleIDs.iterator(); 
			int i = 0; 
			while(itUserRoleIDs.hasNext()){ 
				//check if user is registered to all required roles for approval 
				int iRole = itUserRoleIDs.next(); 
				i++; 
			} 
			if (i==vUserRoleIDs.size()){ 
				this.vApprovalUsers.addElement(user.getUserID());