001package com.hfg.bio.seq.format.feature.uniprot; 002 003import java.util.Collection; 004import java.util.HashMap; 005import java.util.Map; 006 007import com.hfg.bio.seq.format.GenBank; 008import com.hfg.util.StringUtil; 009 010//------------------------------------------------------------------------------ 011/** 012 UniProt feature table qualifier names for flat-file records. 013 <div> 014 @author J. Alex Taylor, hairyfatguy.com 015 </div> 016 */ 017//------------------------------------------------------------------------------ 018// com.hfg Library 019// 020// This library is free software; you can redistribute it and/or 021// modify it under the terms of the GNU Lesser General Public 022// License as published by the Free Software Foundation; either 023// version 2.1 of the License, or (at your option) any later version. 024// 025// This library is distributed in the hope that it will be useful, 026// but WITHOUT ANY WARRANTY; without even the implied warranty of 027// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 028// Lesser General Public License for more details. 029// 030// You should have received a copy of the GNU Lesser General Public 031// License along with this library; if not, write to the Free Software 032// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 033// 034// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 035// jataylor@hairyfatguy.com 036//------------------------------------------------------------------------------ 037 038public class UniProtFeatureQualifierName 039{ 040 private String mName; 041 042 private static Map<String, UniProtFeatureQualifierName> sUniqueMap = new HashMap<>(); 043 044 public static final UniProtFeatureQualifierName FTId = new UniProtFeatureQualifierName("FTId"); // Unique and stable feature identifier 045 046 //########################################################################### 047 // CONSTRUCTORS 048 //########################################################################### 049 050 //--------------------------------------------------------------------------- 051 private UniProtFeatureQualifierName(String inName) 052 { 053 mName = inName; 054 sUniqueMap.put(mName, this); 055 } 056 057 //########################################################################### 058 // PUBLIC METHODS 059 //########################################################################### 060 061 //--------------------------------------------------------------------------- 062 public static UniProtFeatureQualifierName valueOf(String inValue) 063 { 064 UniProtFeatureQualifierName qualifierName = sUniqueMap.get(inValue); 065 if (null == qualifierName) 066 { 067 qualifierName = new UniProtFeatureQualifierName(inValue); 068 GenBank.getLogger().warning(StringUtil.singleQuote(inValue) + " is not a recognized UniProt feature qualifier!"); 069 } 070 071 return qualifierName; 072 } 073 074 //--------------------------------------------------------------------------- 075 public static Collection<UniProtFeatureQualifierName> values() 076 { 077 return sUniqueMap.values(); 078 } 079 080 //--------------------------------------------------------------------------- 081 public String name() 082 { 083 return mName; 084 } 085 086 //--------------------------------------------------------------------------- 087 @Override 088 public String toString() 089 { 090 return name(); 091 } 092}