View Javadoc

1   package migratool.datasources.geometric;
2   
3   import migratool.datasources.AbstractDestinationDataSource;
4   import migratool.datasources.AbstractOriginDataSource;
5   import migratool.datasources.superDataSourceFactory.DataSourceFactoryIF;
6   import migratool.definition.parser.MigBean;
7   
8   /**
9    * 
10   * MIGRATOOL Program to migrate spatial databsets.
11   * Copyright (C) 2007 Fábio Luiz Leite Júnior
12   * Universidade Federal de Campina Grande
13   * contact: fabioleite@gmail.com
14   *
15   * This program is free software; you can redistribute it and/or
16   * modify it under the terms of the GNU General Public License
17   * as published by the Free Software Foundation; either version 2
18   * of the License, or (at your option) any later version.
19   *
20   * This program is distributed in the hope that it will be useful,
21   * but WITHOUT ANY WARRANTY; without even the implied warranty of
22   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23   * GNU General Public License for more details.
24   *
25   * You should have received a copy of the GNU General Public License
26   * along with this program; if not, write to the Free Software
27   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
28   *
29   * @author fabio
30   *
31   */
32  
33  public class GeometricDataSourceFactory implements DataSourceFactoryIF{
34  
35  	/** Singleton */
36  	private static GeometricDataSourceFactory singleton;
37  	private MigBean migDescription;
38  
39  
40  	private GeometricDataSourceFactory(MigBean migDescription){
41  		this.migDescription = migDescription; 
42  	}
43  
44  	/**
45  	 * M�todo que retorna a inst�ncia do Singleton
46  	 * @return Uma f�brica de Formatters SVG
47  	 */
48  	public static GeometricDataSourceFactory getInstance(MigBean migDescription) {
49  		if (singleton == null)
50  			singleton = new GeometricDataSourceFactory(migDescription);
51  		return singleton;
52  	}
53  
54  	public AbstractOriginDataSource getOriginDataSource() {
55  		return new GeometricOriginDataSource(migDescription.getSource());
56  	}
57  
58  	public AbstractDestinationDataSource getDestinationDataSource() {
59  		return  new GeometricDestinationDataSource(migDescription.getDestination());
60  	}
61  	
62  	public String toString(){
63  		return "GeometricDataSourceFactory";
64  	}
65  
66  }