001/** 002 * Copyright (C) 2010-2015 The Roslin Institute <contact andy.law@roslin.ed.ac.uk> 003 * 004 * This file is part of JEnsembl: a Java API to Ensembl data sources developed by the 005 * Bioinformatics Group at The Roslin Institute, The Royal (Dick) School of 006 * Veterinary Studies, University of Edinburgh. 007 * 008 * Project hosted at: http://jensembl.sourceforge.net 009 * 010 * This is free software: you can redistribute it and/or modify 011 * it under the terms of the GNU General Public License (version 3) as published by 012 * the Free Software Foundation. 013 * 014 * This software is distributed in the hope that it will be useful, 015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 017 * GNU General Public License for more details. 018 * 019 * You should have received a copy of the GNU General Public License 020 * in this software distribution. If not, see: http://opensource.org/licenses/gpl-3.0.html 021 */ 022package uk.ac.roslin.ensembl.config; 023 024import java.util.Collection; 025import java.util.HashMap; 026import uk.ac.roslin.ensembl.model.core.CoordSystemType; 027import uk.ac.roslin.ensembl.model.core.CoreObjectType; 028 029/** 030 * 031 * @author paterson 032 */ 033public class AssemblyExceptionType extends EnsemblType implements CoreObjectType, CoordSystemType { 034 035 036 public static AssemblyExceptionType PAR; 037 public static AssemblyExceptionType PATCH_NOVEL; 038 public static AssemblyExceptionType PATCH_FIX; 039 public static AssemblyExceptionType HAP; 040 public static AssemblyExceptionType UNKNOWN; 041 042 043 private static HashMap<String,AssemblyExceptionType> types = AssemblyExceptionType.init(); 044 045 public static Collection<AssemblyExceptionType> values() { 046 return types.values(); 047 } 048 049 private AssemblyExceptionType(String type) { 050 label = type; 051 } 052 053 private static HashMap<String,AssemblyExceptionType> init() { 054 HashMap<String,AssemblyExceptionType> out = new HashMap<String,AssemblyExceptionType>(); 055 PAR = new AssemblyExceptionType("PAR"); 056 out.put(PAR.toString(),PAR); 057 HAP = new AssemblyExceptionType("HAP"); 058 out.put(HAP.toString(),HAP); 059 PATCH_FIX = new AssemblyExceptionType("PATCH_FIX"); 060 out.put(PATCH_FIX.toString(),PATCH_FIX); 061 PATCH_NOVEL = new AssemblyExceptionType("PATCH_NOVEL"); 062 out.put(PATCH_NOVEL.toString(),PATCH_NOVEL); 063 064 UNKNOWN = new AssemblyExceptionType("UNKNOWN"); 065 out.put(UNKNOWN.toString(),UNKNOWN); 066 067 068 return out; 069 } 070 071 public static AssemblyExceptionType getType(String name) { 072 073 AssemblyExceptionType out = types.get(name.toUpperCase()); 074 075 if (out == null) { 076 out = AssemblyExceptionType.UNKNOWN; 077 } 078 079 return out; 080 081 } 082 083 084 @Override 085 public String toString() { 086 return label; 087 } 088 089 090 091}