1 /* 2 * Jalview - A Sequence Alignment Editor and Viewer (2.11.1.4) 3 * Copyright (C) 2021 The Jalview Authors 4 * 5 * This file is part of Jalview. 6 * 7 * Jalview is free software: you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation, either version 3 10 * of the License, or (at your option) any later version. 11 * 12 * Jalview is distributed in the hope that it will be useful, but 13 * WITHOUT ANY WARRANTY; without even the implied warranty 14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 15 * PURPOSE. See the GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>. 19 * The Jalview Authors are detailed in the 'AUTHORS' file. 20 */ 21 package jalview.io.packed; 22 23 /** 24 * API for a data provider that can be used with 25 * jalview.io.packed.ParsePackedSet 26 * 27 * @author JimP 28 * 29 */ 30 public interface DataProvider 31 { 32 /** 33 * class of data expected to be provided by datasource 34 * 35 * @author JimP 36 * 37 */ 38 public enum JvDataType 39 { 40 /** 41 * any alignment flatfile recognisable by jalview.io.IdentifyFile 42 */ 43 ALIGNMENT, 44 /** 45 * a jalview annotation file 46 */ 47 ANNOTATION, 48 /** 49 * a GFF or Jalview features file 50 */ 51 FEATURES, 52 /** 53 * a tree representation understood by the NewickFile parser 54 */ 55 TREE, 56 /** 57 * any file that provides data that should be associated with a specified 58 * sequence. 59 */ 60 SEQASSOCATED; 61 } 62 63 /** 64 * data to be parsed according to its type. Each call to getDataSource should 65 * return a new instance of the same data stream initialised to the beginning 66 * of the chunk of data that is to be parsed. 67 * 68 * @return 69 */ getDataSource()70 jalview.io.FileParse getDataSource(); 71 72 /** 73 * association context for data. Either null or a specific sequence. 74 * 75 * @return 76 */ getSequenceTarget()77 Object getSequenceTarget(); 78 79 /** 80 * type of data 81 * 82 * @return 83 */ getType()84 DataProvider.JvDataType getType(); 85 } 86