package ucsbCurriculum.Utility;

import java.util.ArrayList;

import stub.Time;

public class Util {
	
	// return true if those two Time have conflicts
	public static boolean have_conflict(Time t1, Time t2){
		return t1.startTime > t2.startTime ? (t1.startTime > t2.endTime) : (t2.startTime > t1.startTime);
	}
	
//  save for later, this can be used for compare when adding classes
	public static boolean compare(ArrayList<Time> time1, ArrayList<Time> time2){
		int len1 = time1.size();
		int len2 = time2.size();
		
		for(int i = 0; i < len1; i++){
			for(int j = 0; j < len2; j++){
				if(have_conflict(time1.get(i), time2.get(j))){
					// TO-DO: delete that element in the second list
					time2.remove(j);
				}
			}
		}
	
		// TO-DO: check the size of time2, if it's 0, return false, otherwise return true
//		return false; 
		if(time2.size()==0){
			return false;
		}
		else{
			return true;
		}
	}
	
	public static int converts_to_minute(String day, String t){
		return 1;
	}
	public static int converts_to_string(int minutes){
		return 1;
	}
}

@@ -66,12 +66,30 @@
 ort 
-stub
+ucsbCurriculum.Utility
 .Tim
@@ -228,33 +228,34 @@
 %09return t1.start
-T
+_t
 ime %3E t2.startTi
@@ -248,25 +248,26 @@
 e %3E t2.start
-T
+_t
 ime ? (t1.st
@@ -265,25 +265,26 @@
  ? (t1.start
-T
+_t
 ime %3E t2.end
@@ -283,17 +283,18 @@
 %3E t2.end
-T
+_t
 ime) : (
@@ -301,17 +301,18 @@
 t2.start
-T
+_t
 ime %3E t1
@@ -317,17 +317,18 @@
 t1.start
-T
+_t
 ime);%0A%09%7D

fix errors