c = (Call) unfilteredCallerData.elementAt(middle+1); tmpMiddle = middle +1;
c = (Call) unfilteredCallerData.elementAt(tmpMiddle);
     public boolean contains(Call newCall){    	 int left, right, middle;    	 left = 0;    	 right = unfilteredCallerData.size() -1;    	     	 while(left <= right){    		 middle = ((right-left)/2)+left;    	            		 if(unfilteredCallerData.isEmpty())    			 return false;    	            		 Call c = (Call) unfilteredCallerData.elementAt(middle);    		 int Compare = newCall.getCalldate().compareTo(c.getCalldate());    	            		 //check if the date is before or after the current element in the vector    		 //Note: change the values here to fit the current sorting method    		 if(Compare > 0)    			 right = middle-1;	    		 else if(Compare < 0)	    			 left = middle+1;    		 else{          	        	//if we are here, then the dates match    	        	//lets check if everything else matches    	        	if(c.equals(newCall))    	        		return true;    	        	else{    	        		    	        		//two calls, same date, different values...    	        		//this is really a performance killer...    	        		int tmpMiddle = middle -1;    	        		    	        		//Yikes! Don't forget to stay in the array bounds    	        		    	        		if(tmpMiddle >= 0){    	        		  		c = (Call) unfilteredCallerData.elementAt(tmpMiddle);    	        		    	        		  		//search left as long as the dates still match    	        		  		while(c.getCalldate().equals(newCall.getCalldate())){    	        			    	        		  			//check if equal    	        		  			if(c.equals(newCall))    	        		  				return true;    	        		  			    	        		  			//make sure we stay in the array bounds    	        		  			if(tmpMiddle > 0)    	        		  				c = (Call) unfilteredCallerData.elementAt(--tmpMiddle);    	        		  			else    	        		  				break;    	        		  		}    	        		}    	        		    	        		if(tmpMiddle < unfilteredCallerData.size()){    	        			c = (Call) unfilteredCallerData.elementAt(middle+1);    	        			tmpMiddle = middle +1;    	        		    	        			//search right as long as the dates still match    	        			while(c.getCalldate().equals(newCall.getCalldate())){    	        			    	        				//check if equal    	        				if(c.equals(newCall))    	        					return true;    	    	        	        	        				//make sure to stay in the array bounds    	        				if(tmpMiddle < (unfilteredCallerData.size() -1))	        		    	        					c = (Call) unfilteredCallerData.elementAt(++tmpMiddle);    	        				else    	        					break;    	        			}    	        	    	        		}    	        		    	        		//No matching calls found with the same date    	        		return false;    	        	    	        	}    	        }     	 }    	     	 //we exited the loop => no matching date found    	 return false;          }