public IntervalManager(List<Interval> inters)
	{
		intervals = new ArrayList<Interval>();
		intervals.addAll(inters);
		
		endPoints = new ArrayList<Endpoint>();
		
		
		for (int i = 0; i < intervals.size(); ++i)
		{
			
			Endpoint endPoint = new Endpoint();
			endPoint.type = Endpoint.Type.BEGIN;
			endPoint.value = intervals.get(i).end[0].value;
			endPoint.index = i;
			
			endPoints.add(2*i, endPoint);
			
			endPoint = new Endpoint();
			endPoint.type = Endpoint.Type.END;
			endPoint.value = intervals.get(i).end[1].value;
			endPoint.index = i;
			
			endPoints.add(2*i + 1, endPoint);
		}
		
		/*
		for (int i = 0; i < endPoints.size(); i++)
		{
			System.out.print(endPoints.get(i).toString() + ",");
			System.out.println();
		}
		*/
		Collections.sort(endPoints);
		
		/*
		for (int i = 0; i < endPoints.size(); i++)
		{
			System.out.print(endPoints.get(i).toString() + ",");
			System.out.println();
		}
		*/
		lookUp = new ArrayList<Integer>();
		
		for (int j = 0; j < endPoints.size(); j++)
		{
			lookUp.add(null);
		}
		
		for (int j = 0; j < endPoints.size(); ++j)
		{
			
			lookUp.set(2*endPoints.get(j).index + 
					endPoints.get(j).type.ordinal(), new Integer(j));
			
		}
		
		/*
		for (int i = 0; i < endPoints.size(); i++)
		{
			System.out.print(lookUp.get(i).toString() + ",");
			System.out.println();
		}
		*/
		Set<Integer> active = new LinkedHashSet<Integer>();
		
		overLaps = new LinkedHashSet<Pair>();
		
		for (int i = 0; i < endPoints.size(); ++i)
		{
			Endpoint endpoint = new Endpoint(endPoints.get(i));
			Integer index = new Integer(endpoint.index);
			
			if (endpoint.type.ordinal() == Endpoint.Type.BEGIN.ordinal())
			{
				Iterator<Integer> iterator = active.iterator();
				
				while (iterator.hasNext())
				{
					Integer activeIndex = iterator.next(); 
					
					if (activeIndex < index)
					{
						overLaps.add(new Pair(activeIndex, index));
					}
					else
					{
						overLaps.add(new Pair(index, activeIndex));
					}
				}
				
				active.add(new Integer(index));
			}
			else
			{
				active.remove(new Integer(index));
			}
		}
			
	}