View Javadoc

1   /*
2    * Copyright 2006 - 2012 Christina Bohk and Roland Ewald
3    *  
4    * Licensed under the Apache License, Version 2.0 (the "License"); 
5    * you may not use this file except in compliance with the License. 
6    * You may obtain a copy of the License at 
7    *  
8    *  http://www.apache.org/licenses/LICENSE-2.0
9    *  
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13   * See the License for the specific language governing permissions and 
14   * limitations under the License. 
15   */
16  package p3j.pppm.readerwriter.file;
17  
18  import james.core.data.model.IModelReader;
19  import james.core.data.model.ModelFileReaderFactory;
20  import james.core.data.model.read.plugintype.IMIMEType;
21  import james.core.model.IModel;
22  import james.core.model.symbolic.ISymbolicModel;
23  import james.core.parameters.ParameterBlock;
24  import p3j.pppm.ProjectionModel;
25  import p3j.pppm.SymbolicProjectionModel;
26  
27  /**
28   * Factory for reader/writer of PPPM files.
29   * 
30   * TODO: Finish this, use {@link p3j.misc.Serializer}.
31   * 
32   * @author Christina Bohk
33   * @author Roland Ewald
34   * 
35   */
36  public class PPPModelFileReaderWriterFactory extends ModelFileReaderFactory {
37  
38  	/** Serialization ID. */
39  	private static final long serialVersionUID = -7324702277171597907L;
40  
41  	@Override
42  	public String getDescription() {
43  		return "Probabilistic Population Projections";
44  	}
45  
46  	@Override
47  	public String getFileEnding() {
48  		return "p3j";
49  	}
50  
51  	@Override
52  	public IModelReader create(ParameterBlock params) {
53  		return null;
54  	}
55  
56  	@Override
57  	public boolean supportsModel(IModel model) {
58  		return model instanceof ProjectionModel;
59  	}
60  
61  	@Override
62  	public boolean supportsModel(ISymbolicModel<?> model) {
63  		return model instanceof SymbolicProjectionModel;
64  	}
65  
66  	@Override
67  	public boolean supportsMIMEType(IMIMEType mime) {
68  		return false;
69  	}
70  
71  }