001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package org.biojava.bio.seq.io.agave;
022import java.util.ArrayList;
023import java.util.Iterator;
024import java.util.List;
025
026import org.biojava.bio.Annotation;
027
028/**
029 * Basic implementation of AGAVEAnnotFilter
030 * @author Hanning Ni    Doubletwist Inc
031*/
032public class SimpleAnnotFilter implements AGAVEAnnotFilter{
033
034  public static final AGAVEAnnotFilterFactory SIMPLE_ANNOT_FILTER_FACTORY
035    = new AGAVEAnnotFilterFactory() {
036    public AGAVEAnnotFilter getInstance() {
037      return new SimpleAnnotFilter();
038    }
039  };
040
041  SimpleAnnotFilter() {
042  }
043
044   /**
045     *
046     */
047   public String getAccession(Annotation annot)
048   {
049       return (String) null ;
050   }
051
052        /**
053         *
054         */
055    public String getKeyword(Annotation annot)
056    {
057        return (String) null;
058    }
059    public String getElementId(Annotation annot)
060    {
061        return (String) null ;
062    }
063        /**
064         *
065         */
066    public String getOrganism(Annotation annot)
067    {
068        return (String) null ;
069    }
070
071    public String getLabel(Annotation annot)
072    {
073        return (String) null;
074    }
075
076        /**
077         *
078         */
079    public String getDescription(Annotation annot)
080    {
081        return (String) null;
082    }
083
084    public String getMatchAlign(Annotation annot)
085    {
086        return (String) null ;
087    }
088
089    public AGAVEMatchRegion getMatchRegion(Annotation annot)
090    {
091        return (AGAVEMatchRegion) null ;
092    }
093
094    public AGAVEQueryRegion getQueryRegion(Annotation annot)
095    {
096        return (AGAVEQueryRegion) null ;
097    }
098
099    public String getClassifySystem(Annotation annot)
100    {
101        return (String) null ;
102    }
103
104    public String getClassifyId(Annotation annot)
105    {
106        return (String) null ;
107    }
108
109    public String getClassifyType(Annotation annot)
110    {
111        return (String) null ;
112    }
113
114    public String[] getExonIds(Annotation annot)
115    {
116        return (String[])null ;
117    }
118
119    public String getChromNum(Annotation annot)
120    {
121        return (String)null ;
122    }
123
124    public AGAVEIdAlias[] getIdAlias(Annotation annot)
125    {
126        return (AGAVEIdAlias[])null ;
127    }
128        /**
129         *
130         */
131    public String getNote(Annotation annot)
132    {
133        return (String) null ;
134    }
135
136    public AGAVEDbId[] getAltIds(Annotation annot)
137    {
138       return (AGAVEDbId[])null ;
139    }
140
141    public AGAVEMapLocation[]  getMapLocation(Annotation annot)
142    {
143       return (AGAVEMapLocation[]) null  ;
144    }
145
146    public AGAVERelatedAnnot[]  getRelatedAnnot(Annotation annot)
147    {
148       return (AGAVERelatedAnnot[]) null ;
149    }
150
151    public String[]  getElementIds(Annotation annot)
152    {
153       return (String[]) null ;
154    }
155
156     public String getGroupOrder(Annotation annot)
157     {
158         return (String) null ;
159     }
160
161     public String getMatchDesc(Annotation annot)
162     {
163         return (String) null ;
164     }
165
166     public String getFeatureType(Annotation annot)
167     {
168         return (String) null ;
169     }
170     public String getResultType(Annotation annot)
171     {
172         return (String) null ;
173     }
174
175     public String getConfidence(Annotation annot)
176     {
177         return (String) null ;
178     }
179
180     public String getAlignLength(Annotation annot)
181     {
182         return (String) null ;
183     }
184
185     public String getAlignUnits(Annotation annot)
186     {
187         return (String) null ;
188     }
189
190
191    public AGAVEXrefs[] getXrefs(Annotation annot)
192    {
193       return (AGAVEXrefs[])null ;
194    }
195        /**
196         *
197         */
198     public String getVersion(Annotation annot)
199     {
200         return (String) null ;
201     }
202
203     public String getSequenceId(Annotation annot)
204     {
205         return (String) null ;
206     }
207
208    public String getTaxonId(Annotation annot)
209    {
210         return (String) null ;
211     }
212
213     public String getCloneId(Annotation annot)
214     {
215         return (String) null ;
216     }
217
218     public String getCloneLibrary(Annotation annot)
219     {
220         return (String) null ;
221     }
222
223     public String getChromosome(Annotation annot)
224     {
225         return (String) null ;
226     }
227
228     public String getMapPosition(Annotation annot)
229     {
230         return (String) null ;
231     }
232
233     public String getEcNumber(Annotation annot)
234     {
235         return (String) null ;
236     }
237
238      public String getCreateDate(Annotation annot)
239     {
240         return (String) null ;
241     }
242
243     public String getUpdateDate(Annotation annot)
244     {
245         return (String) null ;
246     }
247
248
249        /**
250         *
251         */
252     public String getOS(Annotation annot)
253     {
254         return (String) null ;
255     }
256
257        /**
258         *
259         */
260     public String getMolType(Annotation annot)
261     {
262           return (String) null;
263     }
264
265     public AGAVEDbId getDbId(Annotation annot)
266     {
267          return (AGAVEDbId) null ;
268     }
269        /**
270         *   ThomasD made this a bit safer...
271         */
272     public AGAVEProperty[] getProperty(Annotation annot, String type)
273     {
274         List set = new ArrayList();
275         for (Iterator i = annot.keys().iterator(); i.hasNext();)
276             {
277                 Object key = i.next();
278                 Object value = annot.getProperty(key);
279                 if (key instanceof String && value instanceof String) {
280                     set.add(new AGAVEProperty(type, (String) key, null, (String) value ));
281                 }
282             }
283         return (AGAVEProperty[]) set.toArray(new AGAVEProperty[set.size()]);
284     }
285}