inprogress
[jalview.git] / forester / java / src / org / forester / go / BasicGoXRef.java
index 8d5b4ae..548a7a6 100644 (file)
@@ -5,7 +5,7 @@
 // Copyright (C) 2008-2009 Christian M. Zmasek
 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
 // All rights reserved
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 // Lesser General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.go;
 
@@ -81,8 +81,26 @@ public class BasicGoXRef implements GoXRef {
         else if ( type.equals( WIKIPEDIA_STR ) ) {
             _type = Type.WIKIPEDIA;
         }
+        else if ( type.equals( RHEA_STR ) ) {
+            _type = Type.RHEA;
+        }
+        else if ( type.equals( NIF_SUBCELLULAR_STR ) ) {
+            _type = Type.NIF_SUBCELLULAR;
+        }
+        else if ( type.equals( CORUM_STR ) ) {
+            _type = Type.CORUM;
+        }
+        else if ( type.equals( UNIPATHWAY_STR ) ) {
+            _type = Type.UNIPATHWAY;
+        }
+        else if ( type.equals( PO_STR ) ) {
+            _type = Type.PO;
+        }
+        else if ( type.equals( SABIO_RK_STR ) ) {
+            _type = Type.SABIO_RK;
+        }
         else {
-            throw new IllegalArgumentException( "unknown GO xref type: " + type );
+            _type = Type.OTHER;
         }
         _xref = sa[ 1 ].trim();
     }
@@ -92,6 +110,7 @@ public class BasicGoXRef implements GoXRef {
         _xref = xref;
     }
 
+    @Override
     public int compareTo( final GoXRef xref ) {
         return getXRef().compareTo( xref.getXRef() );
     }
@@ -117,6 +136,7 @@ public class BasicGoXRef implements GoXRef {
         }
     }
 
+    @Override
     public Type getType() {
         return _type;
     }
@@ -172,6 +192,9 @@ public class BasicGoXRef implements GoXRef {
             case WIKIPEDIA:
                 sb.append( WIKIPEDIA_STR );
                 break;
+            case OTHER:
+                sb.append( "other" );
+                break;
             default:
                 new AssertionError( "unknown type: " + getType() );
         }