/* * TrabalhoFactory.java * * Created on 15 de Julho de 2007, 22:45 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package helper; import s3e.Atividade; import s3e.Projeto; import s3e.Trabalho; /** * * @author Eduardo */ public class TrabalhoFactory { /** Creates a new instance of TrabalhoFactory */ public TrabalhoFactory() { } public static Trabalho makeTrabalho(String tipo) { if(tipo.equals("Projeto")) return new Projeto(); else if(tipo.equals("Mesa-redonda") || tipo.equals("Palestra") || tipo.equals("Mini-curso") || tipo.equals("Workshop") || tipo.equals("Poster")) return new Atividade(tipo); else return null; } }