src/main/java/org/vivoweb/harvester/ingest/AppointmentsFetchFromED.java
/**
		 * <p>This function checks for tenure tracks in appointments and then merges them if found</p>
		 * @param roles list of role bean objects
		 * @return roles list of role bean objects
		 */
This function checks for tenure tracks in appointments and then merges them if found
@param roles list of role bean objects
@return roles list of role bean objects
This function checks for tenure tracks in appointments and then merges them if found @param roles list of role bean objects @return roles list of role bean objects
private ArrayList<RoleBean> checkForTenureTrack(ArrayList<RoleBean> roles) {
			List<RoleBean> indexesToRemove = new ArrayList<>();
			for(int i=0 ; i < roles.size() -1 ; i++) {
				int index = i;
				for(int j = i+1; j < roles.size(); j++){
					if(roles.get(j).compareTo(roles.get(index))==1) {
						log.info("Found Tenure Track");
						log.info(roles.get(j).getDepartment() + " && " + roles.get(index).getDepartment() +  " :: " + roles.get(j).getTitleCode() + " && " + roles.get(index).getTitleCode() );
						if(Integer.parseInt(roles.get(j).getStartDate()) > Integer.parseInt(roles.get(index).getStartDate())){
							roles.get(j).setStartDate(roles.get(index).getStartDate());
							indexesToRemove.add(roles.get(index));
						} else if(Integer.parseInt(roles.get(j).getStartDate()) == Integer.parseInt(roles.get(index).getStartDate())) {
							if(roles.get(j).getEndDate() != null 
								&& 
								roles.get(j).getEndDate().equals("CURRENT")
								) {
								indexesToRemove.add(roles.get(index));
								break;
							}
							if(roles.get(index).getEndDate() != null 
								&& 
								roles.get(index).getEndDate().equals("CURRENT")
								) {
								indexesToRemove.add(roles.get(j));
								break;
							}
						} else {
							roles.get(index).setStartDate(roles.get(j).getStartDate());
							indexesToRemove.add(roles.get(j));
							break;
						}
					}
				}
			}
			roles.removeAll(indexesToRemove);
			for(RoleBean rb: roles) {
				log.info("Position - " + rb.toString());
			}
			return roles;
		}
private ArrayList < RoleBean > checkForTenureTrack ( ArrayList < RoleBean > roles ) { List < RoleBean > indexesToRemove = new ArrayList < > ( ) ; for ( int i = 0 ; i < roles . size ( ) - 1 ; i ++ ) { int index = i ; for ( int j = i + 1 ; j < roles . size ( ) ; j ++ ) { if ( roles . get ( j ) . compareTo ( roles . get ( index ) ) == 1 ) { log . info ( "Found Tenure Track" ) ; log . info ( roles . get ( j ) . getDepartment ( ) + " && " + roles . get ( index ) . getDepartment ( ) + " :: " + roles . get ( j ) . getTitleCode ( ) + " && " + roles . get ( index ) . getTitleCode ( ) ) ; if ( Integer . parseInt ( roles . get ( j ) . getStartDate ( ) ) > Integer . parseInt ( roles . get ( index ) . getStartDate ( ) ) ) { roles . get ( j ) . setStartDate ( roles . get ( index ) . getStartDate ( ) ) ; indexesToRemove . add ( roles . get ( index ) ) ; } else if ( Integer . parseInt ( roles . get ( j ) . getStartDate ( ) ) == Integer . parseInt ( roles . get ( index ) . getStartDate ( ) ) ) { if ( roles . get ( j ) . getEndDate ( ) != null && roles . get ( j ) . getEndDate ( ) . equals ( "CURRENT" ) ) { indexesToRemove . add ( roles . get ( index ) ) ; break ; } if ( roles . get ( index ) . getEndDate ( ) != null && roles . get ( index ) . getEndDate ( ) . equals ( "CURRENT" ) ) { indexesToRemove . add ( roles . get ( j ) ) ; break ; } } else { roles . get ( index ) . setStartDate ( roles . get ( j ) . getStartDate ( ) ) ; indexesToRemove . add ( roles . get ( j ) ) ; break ; } } } } roles . removeAll ( indexesToRemove ) ; for ( RoleBean rb : roles ) { log . info ( "Position - " + rb . toString ( ) ) ; } return roles ; }
<p>This function checks for tenure tracks in appointments and then merges them if found</p>
 @param roles list of role bean objects
 @return roles list of role bean objects
<p > This function checks for tenure tracks in appointments and then merges them if found< / p > @param roles list of role bean objects @return roles list of role bean objects