001package com.hfg.bio.seq;
002
003
004//------------------------------------------------------------------------------
005/**
006 * Enumeration of biological sequence types.
007 *
008 * @author J. Alex Taylor, hairyfatguy.com
009 */
010//------------------------------------------------------------------------------
011// com.hfg XML/HTML Coding Library
012//
013// This library is free software; you can redistribute it and/or
014// modify it under the terms of the GNU Lesser General Public
015// License as published by the Free Software Foundation; either
016// version 2.1 of the License, or (at your option) any later version.
017//
018// This library is distributed in the hope that it will be useful,
019// but WITHOUT ANY WARRANTY; without even the implied warranty of
020// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
021// Lesser General Public License for more details.
022//
023// You should have received a copy of the GNU Lesser General Public
024// License along with this library; if not, write to the Free Software
025// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026//
027// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
028// jataylor@hairyfatguy.com
029//------------------------------------------------------------------------------
030
031public enum BioSequenceType
032{
033   PROTEIN('p'),
034   NUCLEIC_ACID('n');
035   
036   private char mAbbrev;
037
038   //---------------------------------------------------------------------------
039   private BioSequenceType(char inAbbrev)
040   {
041      mAbbrev = inAbbrev;
042   }
043
044   //---------------------------------------------------------------------------
045   public char getAbbrev()
046   {
047      return mAbbrev;
048   }
049
050   //---------------------------------------------------------------------------
051   public static BioSequenceType valueOf(char inAbbrev)
052   {
053      BioSequenceType result = null;
054      for (BioSequenceType value : values())
055      {
056         if (value.getAbbrev() == inAbbrev)
057         {
058            result = value;
059            break;
060         }
061      }
062      
063      return result;
064   }
065}