package edu.sc.seis.gee.task;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;

/**
 * TaskUtils.java
 *
 *
 * Created: Wed Feb  6 12:34:45 2002
 *
 * @author <a href="mailto:crotwell@pooh">Philip Crotwell</a>
 * @version
 */

public class TaskUtils {
    public TaskUtils (){
	
    }
    
    public static String[] getParamStartsWith(String name, Map params) {
	LinkedList out = new LinkedList();
	Iterator iter = params.keySet().iterator();
	while (iter.hasNext()) {
	    String key = (String)iter.next();
	    if (key.startsWith(name)) {
		out.add(params.get(key));
	    } // end of if (key.startsWith(name))
	    
	} // end of while (iter.hasNext())
	return (String[])out.toArray(new String[0]);
    }

}// TaskUtils
