/* Copyright (c) 2016, Codesign And Parallel processing Laboratory (CAPLab)
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * Neither the name of the Codesign And Parallel processing Laboratory (CAPLab) 
 * nor the names of its contributors may be used to endorse or promote products
 * derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package HPA;

import java.util.ArrayList;
import java.util.Iterator;

public class TaskList extends ArrayList<Task>
{
	public Task getFromId(int subtaskID)
	{		
		Iterator iter = iterator();
		while(iter.hasNext())
		{
			Task st = (Task)iter.next();
			if(st.id == subtaskID)
				return st;
		}
		System.err.println("There is no subtask ID["+subtaskID+"]");
//		System.exit(1);
		return null;		
	}
	
	public Task getFromBaseId(int subtaskBaseID)
	{
		Iterator iter = iterator();
		while(iter.hasNext())
		{
			Task st = (Task)iter.next();
			if(st.getBaseId() == subtaskBaseID)
				return st;
		}
		System.err.println("There is no subtask baseID["+subtaskBaseID+"]");
//		System.exit(1);
		return null;		
	}
	
	public boolean containsFromId(int subtaskID)
	{
		Iterator iter = iterator();
		while(iter.hasNext())
		{
			Task st = (Task)iter.next();
			if(st.id == subtaskID)
				return true;
		}
		return false;		
	}
}
@@ -1090,16 +1090,16 @@
 POSE
-%0D%0A *
  ARE
+%0D%0A *
  DIS
@@ -1129,47 +1129,29 @@
 ALL 
-HSQL DEVELOPMENT GROUP, HSQLDB.ORG,%0D%0A *
+THE COPYRIGHT HOLDERS
  OR 
@@ -1172,16 +1172,20 @@
 E LIABLE
+%0D%0A *
  FOR ANY
@@ -1223,20 +1223,16 @@
 SPECIAL,
-%0D%0A *
  EXEMPLA
@@ -1251,16 +1251,20 @@
 QUENTIAL
+%0D%0A *
  DAMAGES
@@ -1295,20 +1295,16 @@
 ITED TO,
-%0D%0A *
  PROCURE
@@ -1330,16 +1330,20 @@
 GOODS OR
+%0D%0A *
  SERVICE
@@ -1344,20 +1344,16 @@
 ERVICES;
-%0D%0A *
  LOSS OF
@@ -1409,16 +1409,20 @@
  HOWEVER
+%0D%0A *
  CAUSED 
@@ -1424,20 +1424,16 @@
 USED AND
-%0D%0A *
  ON ANY 
@@ -1495,16 +1495,20 @@
 ITY,
+%0D%0A *
  OR TORT
 %0D%0A *
@@ -1503,20 +1503,16 @@
  OR TORT
-%0D%0A *
  (INCLUD
@@ -1577,16 +1577,20 @@
  USE
+%0D%0A *
  OF THIS
 %0D%0A *
@@ -1585,20 +1585,16 @@
  OF THIS
-%0D%0A *
  SOFTWAR
@@ -2620,8 +2620,10 @@
 %09%0D%0A%09%7D%0D%0A%7D
+%0D%0A

Update TaskList.java