From eea62faa77a04eeb29dff98900e3a933941ddcec Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 3 May 2005 12:38:04 +0000 Subject: [PATCH] Removed as obfuscation of classes wiill change class names --- src/jalview/io/FormatFactory.java | 71 ------------------------- src/jalview/io/FormatProperties.java | 83 ------------------------------ src/jalview/io/FormatProperty.java | 18 ------- src/jalview/io/FormatPropertyVector.java | 32 ------------ 4 files changed, 204 deletions(-) delete mode 100755 src/jalview/io/FormatFactory.java delete mode 100755 src/jalview/io/FormatProperties.java delete mode 100755 src/jalview/io/FormatProperty.java delete mode 100755 src/jalview/io/FormatPropertyVector.java diff --git a/src/jalview/io/FormatFactory.java b/src/jalview/io/FormatFactory.java deleted file mode 100755 index 64abc11..0000000 --- a/src/jalview/io/FormatFactory.java +++ /dev/null @@ -1,71 +0,0 @@ -package jalview.io; - -import jalview.datamodel.*; - -import java.lang.reflect.*; - -public class FormatFactory { - - public static AlignFile get(int index) { - try { - Class c = Class.forName(FormatProperties.getClassName(index)); - Class [] paramTypes = new Class[1]; - paramTypes[0] = SequenceI[].class; - - Constructor cons = c.getConstructor(null); - - return (AlignFile)cons.newInstance(null); - } catch (Exception e) { - System.err.println("Errore FFactory:"+e); - return null; - } - } - - public static AlignFile get(int index,String inStr) { - try { - Class c = Class.forName(FormatProperties.getClassName(index)); - Class [] paramTypes = new Class[1]; - paramTypes[0] = String.class; - Constructor cons = c.getConstructor(paramTypes); - - Object [] params = new Object[1]; - params[0] = inStr; - return (AlignFile)cons.newInstance(params); - } catch (Exception e) { - System.err.println("error2"+e); - return null; - } - } - - public static AlignFile get(int index,String inFile,String type) { - try { - - Class c = Class.forName(FormatProperties.getClassName(index)); - Class [] paramTypes = new Class[2]; - paramTypes[0] = String.class; - paramTypes[1] = String.class; - Constructor cons = c.getConstructor(paramTypes); - Object [] params = new Object[2]; - params[0] = inFile; - params[1] = type; - - AlignFile af = (AlignFile)cons.newInstance(params); - - return af; - } catch (Exception e) { - System.err.println("FormatFactory "+e); - return null; - } - } - - public static AlignFile get(String format) { - return get(FormatProperties.indexOf(format)); - } - - public static AlignFile get(String format,String inStr) { - return get(FormatProperties.indexOf(format),inStr); - } - public static AlignFile get(String format,String inFile,String type) { - return get(FormatProperties.indexOf(format),inFile,type); - } -} diff --git a/src/jalview/io/FormatProperties.java b/src/jalview/io/FormatProperties.java deleted file mode 100755 index 585f220..0000000 --- a/src/jalview/io/FormatProperties.java +++ /dev/null @@ -1,83 +0,0 @@ -/* Jalview - a java multiple alignment editor - * Copyright (C) 1998 Michele Clamp - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -package jalview.io; - -import java.util.*; - -public class FormatProperties { - - static final int FASTA = 0; - static final int MSF = 1; - static final int CLUSTAL = 2; - static final int BLC = 3; - static final int PIR = 4; - static final int PFAM = 5; - - static FormatPropertyVector formats = new FormatPropertyVector(); - - static { - String prefix = getDefaultClassPrefix(); - - formats.add("FASTA", prefix + "FastaFile"); - formats.add("MSF", prefix + "MSFfile"); - formats.add("CLUSTAL",prefix + "ClustalFile"); - formats.add("BLC", prefix + "BLCFile"); - formats.add("PIR", prefix + "PIRFile"); - formats.add("PFAM", prefix + "PfamFile"); - } - - public static String getDefaultClassPrefix() { - return "jalview.io."; - } - - static int indexOf(String format) { - - if (format != null) { - format.toUpperCase(); - if (formats.contains(format)) { - return formats.indexOf(format); - } - } - return -1; - } - - public static String getClassName(int index) { - return formats.getClassName(index); - } - - public static boolean contains(String format) { - - if (format != null) { - format.toUpperCase(); - - if (formats.contains(format)) { - return true; - } - } - return false; - } - - public static Vector getFormatNames() { - return formats.getFormatNames(); - } - - public static Vector getFormats() { - return formats.getFormatNames(); - } -} diff --git a/src/jalview/io/FormatProperty.java b/src/jalview/io/FormatProperty.java deleted file mode 100755 index 2e72ee4..0000000 --- a/src/jalview/io/FormatProperty.java +++ /dev/null @@ -1,18 +0,0 @@ -package jalview.io; - -public class FormatProperty { - String description; - String className; - - public FormatProperty(String description, String className) { - this.description = new String(description); - this.className = new String(className); - } - - public String getClassName() { - return className; - } - public String getDescription() { - return description; - } -} diff --git a/src/jalview/io/FormatPropertyVector.java b/src/jalview/io/FormatPropertyVector.java deleted file mode 100755 index 5fc97b3..0000000 --- a/src/jalview/io/FormatPropertyVector.java +++ /dev/null @@ -1,32 +0,0 @@ -package jalview.io; - -import java.util.*; - -public class FormatPropertyVector { - Vector formatProps = new Vector(); - Vector formatDescs = new Vector(); - - public void add(String description,String className) { - formatProps.addElement(new FormatProperty(description,className)); - formatDescs.addElement(description); - } - public Vector getFormatNames() { - return formatDescs; - } - - public String getClassName(int ind) { - return ((FormatProperty)formatProps.elementAt(ind)).getClassName(); - } - - public String getSchemeName(int ind) { - return ((FormatProperty)formatProps.elementAt(ind)).getDescription(); - } - - public boolean contains(String description) { - return formatDescs.contains(description); - } - - public int indexOf(String description) { - return formatDescs.indexOf(description); - } -} -- 1.7.10.2