private ArrayList<Profile.Entry> toArrayList(int partId,
			double startTime, double finishTime) {
		
		if(partId >= partitions.length || partId < 0) {
			throw new IndexOutOfBoundsException("It is not possible to " +
					"add a partition with index: " + partId + ".");
		}
		
		ArrayList<Entry> subProfile = new ArrayList<Entry>();
		startTime = Math.max(startTime, currentTime());
		Iterator<ProfileEntry> it = avail.itValuesFromPrec(startTime);
		Profile.Entry fe = null;

		// get first entry or create one if the profile is empty
		if(it.hasNext()) {
			PartProfileEntry ent = (PartProfileEntry)it.next();
			PERangeList list = ent.getAvailRanges(partId) == null ? 
					null : ent.getAvailRanges(partId).clone();
			double entTime = Math.max(startTime, ent.getTime());
			fe = new Profile.Entry(entTime, list);
		}
		else {
			fe = new Profile.Entry(startTime);
		}
		subProfile.add(fe);
		
		while(it.hasNext()) {
			PartProfileEntry entry = (PartProfileEntry)it.next();
           	if(entry.getTime() > finishTime) {
           		break;
   			}
           	
			PERangeList list = entry.getAvailRanges(partId) == null ? 
					null : entry.getAvailRanges(partId).clone();
           	
			Profile.Entry newEntry = new Profile.Entry(entry.getTime(), list);
			subProfile.add(newEntry);
        }

		return subProfile;
    }