From 14246cb6d1934f6a32d4cf12e3eff526de6631a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Euzenat?= <Jerome.Euzenat@inria.fr> Date: Mon, 27 Nov 2006 09:58:20 +0000 Subject: [PATCH] - Put the main only as static (old story) --- .../inrialpes/exmo/align/util/EvalAlign.java | 6 +-- .../exmo/align/util/ExtGroupEval.java | 36 +++++++------- src/fr/inrialpes/exmo/align/util/GenPlot.java | 34 ++++++------- .../exmo/align/util/GenTriangle.java | 46 +++++++++--------- .../inrialpes/exmo/align/util/GroupAlign.java | 40 ++++++++-------- .../inrialpes/exmo/align/util/GroupEval.java | 48 +++++++++---------- .../exmo/align/util/ParserPrinter.java | 6 +-- .../inrialpes/exmo/align/util/Procalign.java | 14 +++--- 8 files changed, 115 insertions(+), 115 deletions(-) diff --git a/src/fr/inrialpes/exmo/align/util/EvalAlign.java b/src/fr/inrialpes/exmo/align/util/EvalAlign.java index 5624a4f8..a224ccc9 100644 --- a/src/fr/inrialpes/exmo/align/util/EvalAlign.java +++ b/src/fr/inrialpes/exmo/align/util/EvalAlign.java @@ -101,12 +101,12 @@ $Id$ public class EvalAlign { public static void main(String[] args) { - try { run( args ); } + try { new EvalAlign().run( args ); } catch (Exception e) { e.printStackTrace(); }; } - public static void run(String[] args) { + public void run(String[] args) { Parameters params = new BasicParameters(); Evaluator eval = null; String alignName1 = null; @@ -216,7 +216,7 @@ public class EvalAlign { } } - public static void usage() { + public void usage() { System.err.println("usage: EvalAlign [options] file1 file2"); System.err.println("options are:"); System.err.println("\t--debug[=n] -d [n]\t\tReport debug info at level n"); diff --git a/src/fr/inrialpes/exmo/align/util/ExtGroupEval.java b/src/fr/inrialpes/exmo/align/util/ExtGroupEval.java index 4d0e0085..e5742156 100644 --- a/src/fr/inrialpes/exmo/align/util/ExtGroupEval.java +++ b/src/fr/inrialpes/exmo/align/util/ExtGroupEval.java @@ -95,23 +95,23 @@ $Id$ public class ExtGroupEval { - static Parameters params = null; - static String filename = null; - static String format = "s"; - static int fsize = 2; - static String type = "html"; - static String dominant = "s"; - static Vector listAlgo = null; - static int debug = 0; - static String color = null; - static Hashtable loaded = null; + Parameters params = null; + String filename = null; + String format = "s"; + int fsize = 2; + String type = "html"; + String dominant = "s"; + Vector listAlgo = null; + int debug = 0; + String color = null; + Hashtable loaded = null; public static void main(String[] args) { - try { run( args ); } + try { new ExtGroupEval().run( args ); } catch (Exception ex) { ex.printStackTrace(); }; } - public static void run(String[] args) throws Exception { + public void run(String[] args) throws Exception { String listFile = ""; LongOpt[] longopts = new LongOpt[8]; loaded = new Hashtable(); @@ -181,7 +181,7 @@ public class ExtGroupEval { print( iterateDirectories() ); } - public static Vector iterateDirectories (){ + public Vector iterateDirectories (){ Vector result = null; File [] subdir = null; try { @@ -208,7 +208,7 @@ public class ExtGroupEval { return result; } - public static Vector iterateAlignments ( File dir ) { + public Vector iterateAlignments ( File dir ) { String prefix = dir.toURI().toString()+"/"; Vector result = new Vector(); boolean ok = false; @@ -235,7 +235,7 @@ public class ExtGroupEval { else return (Vector)null; } - public static Evaluator eval( String alignName1, String alignName2 ) { + public Evaluator eval( String alignName1, String alignName2 ) { Evaluator eval = null; try { int nextdebug; @@ -260,7 +260,7 @@ public class ExtGroupEval { /** * This does not only print the results but compute the average as well */ - public static void print( Vector result ) { + public void print( Vector result ) { // variables for computing iterative harmonic means int expected = 0; // expected so far int foundVect[]; // found so far @@ -411,7 +411,7 @@ public class ExtGroupEval { // Borrowed and enhanced from // http://acm.sus.mcgill.ca/20020323/work/acm-19/B.j // What a pity that it is not in Java... (wait for 1.5) - public static void printFormat(PrintStream w, double f){ + public void printFormat(PrintStream w, double f){ // JE: Must add the test is the value is Not a number, print NaN. if ( f != f ) { w.print("NaN"); @@ -426,7 +426,7 @@ public class ExtGroupEval { } } - public static void usage() { + public void usage() { System.out.println("usage: ExtGroupEval [options]"); System.out.println("options are:"); System.out.println("\t--format=seo -r seo\tSpecifies the extended measure used (symetric/effort-based/oriented)"); diff --git a/src/fr/inrialpes/exmo/align/util/GenPlot.java b/src/fr/inrialpes/exmo/align/util/GenPlot.java index f634ae8a..6d6a4f1c 100644 --- a/src/fr/inrialpes/exmo/align/util/GenPlot.java +++ b/src/fr/inrialpes/exmo/align/util/GenPlot.java @@ -97,22 +97,22 @@ import fr.inrialpes.exmo.align.parser.AlignmentParser; public class GenPlot { - static int STEP = 10; - static Parameters params = null; - static Vector listAlgo; - static String fileNames = ""; - static String outFile = null; - static String type = "tsv"; - static int debug = 0; - static Hashtable loaded = null; - static PrintWriter output = null; + int STEP = 10; + Parameters params = null; + Vector listAlgo; + String fileNames = ""; + String outFile = null; + String type = "tsv"; + int debug = 0; + Hashtable loaded = null; + PrintWriter output = null; public static void main(String[] args) { - try { run( args ); } + try { new GenPlot().run( args ); } catch (Exception ex) { ex.printStackTrace(); }; } - public static void run(String[] args) throws Exception { + public void run(String[] args) throws Exception { LongOpt[] longopts = new LongOpt[8]; loaded = new Hashtable(); @@ -189,7 +189,7 @@ public class GenPlot { * The points are computed by aggregating the values * (and in the end computing the average) */ - public static double[][] iterateDirectories (){ + public double[][] iterateDirectories (){ File [] subdir = null; try { subdir = (new File(System.getProperty("user.dir"))).listFiles(); @@ -227,7 +227,7 @@ public class GenPlot { return result; } - public static void iterateAlignments ( File dir, double[][] result ) { + public void iterateAlignments ( File dir, double[][] result ) { String prefix = dir.toURI().toString()+"/"; int i = 0; @@ -254,7 +254,7 @@ public class GenPlot { } catch (Exception ex) { System.err.println(ex); }; } - public static PRGraphEvaluator eval( String alignName1, String alignName2 ) { + public PRGraphEvaluator eval( String alignName1, String alignName2 ) { PRGraphEvaluator eval = null; try { int nextdebug; @@ -287,7 +287,7 @@ public class GenPlot { * This does average plus plot * */ - public static void printPGFTex( double[][] result ){ + public void printPGFTex( double[][] result ){ int i = 0; String marktable[] = { "+", "*", "x", "-", "|", "o", "asterisk", "star", "oplus", "oplus*", "otimes", "otimes*", "square", "square*", "triangle", "triangle*", "diamond", "diamond*", "pentagon", "pentagon*"}; String colortable[] = { "black", "red", "green", "blue", "cyan", "magenta", "yellow" } ; @@ -359,7 +359,7 @@ public class GenPlot { } } - public static void printTSV( double[][] result ) { + public void printTSV( double[][] result ) { // Print first line for ( Enumeration e = listAlgo.elements() ; e.hasMoreElements() ; ) { output.print("\t"+(String)e.nextElement() ); @@ -376,7 +376,7 @@ public class GenPlot { } } - public static void usage() { + public void usage() { System.out.println("usage: GenPlot [options]"); System.out.println("options are:"); System.out.println("\t--type=tsv|tex|(html|xml) -t tsv|tex|(html|xml)\tSpecifies the output format"); diff --git a/src/fr/inrialpes/exmo/align/util/GenTriangle.java b/src/fr/inrialpes/exmo/align/util/GenTriangle.java index 20a47ce6..eadf6c3b 100644 --- a/src/fr/inrialpes/exmo/align/util/GenTriangle.java +++ b/src/fr/inrialpes/exmo/align/util/GenTriangle.java @@ -92,26 +92,26 @@ $Id: GroupEval.java 331 2006-09-21 11:00:15Z euzenat $ public class GenTriangle { - static Parameters params = null; - static String filename = null; - static String reference = "refalign.rdf"; - static String format = "pr"; - static int fsize = 2; - static String type = "html"; - static boolean embedded = false; - static String dominant = "s"; - static Vector listAlgo = null; - static int debug = 0; - static String color = null; - static Hashtable loaded = null; - static String ontoDir = null; + Parameters params = null; + String filename = null; + String reference = "refalign.rdf"; + String format = "pr"; + int fsize = 2; + String type = "html"; + boolean embedded = false; + String dominant = "s"; + Vector listAlgo = null; + int debug = 0; + String color = null; + Hashtable loaded = null; + String ontoDir = null; public static void main(String[] args) { - try { run( args ); } + try { new GenTriangle().run( args ); } catch (Exception ex) { ex.printStackTrace(); }; } - public static void run(String[] args) throws Exception { + public void run(String[] args) throws Exception { String listFile = ""; LongOpt[] longopts = new LongOpt[10]; loaded = new Hashtable(); @@ -195,7 +195,7 @@ public class GenTriangle { print( iterateDirectories() ); } - public static Vector iterateDirectories (){ + public Vector iterateDirectories (){ Vector result = null; File [] subdir = null; try { @@ -227,7 +227,7 @@ public class GenTriangle { return result; } - public static Vector iterateAlignments ( File dir ) { + public Vector iterateAlignments ( File dir ) { String prefix = dir.toURI().toString()+"/"; Vector result = new Vector(); boolean ok = false; @@ -254,7 +254,7 @@ public class GenTriangle { else return (Vector)null; } - public static Evaluator eval( String alignName1, String alignName2 ) { + public Evaluator eval( String alignName1, String alignName2 ) { Evaluator eval = null; try { int nextdebug; @@ -279,15 +279,15 @@ public class GenTriangle { /** * This does not only print the results but compute the average as well */ - public static void print( Vector result ) { + public void print( Vector result ) { if ( type.equals("html") ) printHTML( result ); else if ( type.equals("tex") ) printLATEX( result ); } - public static void printLATEX( Vector result ) { + public void printLATEX( Vector result ) { } - public static void printHTML( Vector result ) { + public void printHTML( Vector result ) { // variables for computing iterative harmonic means int expected = 0; // expected so far int foundVect[]; // found so far @@ -456,7 +456,7 @@ public class GenTriangle { // Borrowed and enhanced from // http://acm.sus.mcgill.ca/20020323/work/acm-19/B.j // What a pity that it is not in Java... (wait for 1.5) - public static void printFormat(PrintStream w, double f){ + public void printFormat(PrintStream w, double f){ // JE: Must add the test is the value is Not a number, print NaN. if ( f != f ) { w.print("NaN"); @@ -471,7 +471,7 @@ public class GenTriangle { } } - public static void usage() { + public void usage() { System.out.println("usage: GroupEval [options]"); System.out.println("options are:"); System.out.println("\t--format=prfmot -r prfmot\tSpecifies the output order (precision/recall/fallout/f-measure/overall/time)"); diff --git a/src/fr/inrialpes/exmo/align/util/GroupAlign.java b/src/fr/inrialpes/exmo/align/util/GroupAlign.java index fd326a6b..b38acce3 100644 --- a/src/fr/inrialpes/exmo/align/util/GroupAlign.java +++ b/src/fr/inrialpes/exmo/align/util/GroupAlign.java @@ -99,27 +99,27 @@ $Id$ public class GroupAlign { - static Parameters params = null; - static String filename = "align"; - static String paramfile = null; - static String urlprefix = null; - static String source = "onto1.rdf"; - static String target = "onto.rdf"; - static URI uri1 = null; - static String initName = null; - static Hashtable loadedOntologies = null; - static OWLRDFErrorHandler handler = null; - static int debug = 0; - static String alignmentClassName = "fr.inrialpes.exmo.align.impl.method.StringDistAlignment"; - static String rendererClass = "fr.inrialpes.exmo.align.impl.renderer.RDFRendererVisitor"; - static String ontoDir = null; + Parameters params = null; + String filename = "align"; + String paramfile = null; + String urlprefix = null; + String source = "onto1.rdf"; + String target = "onto.rdf"; + URI uri1 = null; + String initName = null; + Hashtable loadedOntologies = null; + OWLRDFErrorHandler handler = null; + int debug = 0; + String alignmentClassName = "fr.inrialpes.exmo.align.impl.method.StringDistAlignment"; + String rendererClass = "fr.inrialpes.exmo.align.impl.renderer.RDFRendererVisitor"; + String ontoDir = null; public static void main(String[] args) { - try { run( args ); } + try { new GroupAlign().run( args ); } catch (Exception ex) { ex.printStackTrace(); }; } - public static void run(String[] args) throws Exception { + public void run(String[] args) throws Exception { LongOpt[] longopts = new LongOpt[13]; loadedOntologies = new Hashtable(); @@ -230,7 +230,7 @@ public class GroupAlign { iterateDirectories(); } - public static void iterateDirectories (){ + public void iterateDirectories (){ File [] subdir = null; try { if(ontoDir == null){ @@ -265,7 +265,7 @@ public class GroupAlign { } } - public static void align ( File dir ) throws Exception { + public void align ( File dir ) throws Exception { String prefix = null; // toURI(). is not very good AlignmentProcess result = null; @@ -383,7 +383,7 @@ public class GroupAlign { writer.close(); } - public static OWLOntology loadOntology(URI uri) + public OWLOntology loadOntology(URI uri) throws ParserException, OWLException { OWLOntology parsedOnt = null; OWLRDFParser parser = new OWLRDFParser(); @@ -394,7 +394,7 @@ public class GroupAlign { return parsedOnt; } - public static void usage() { + public void usage() { System.out.println("usage: GroupAlign [options]"); System.err.println("options are:"); System.err.println("\t--name=uri -n uri\t\tUse the given uri to compare with."); diff --git a/src/fr/inrialpes/exmo/align/util/GroupEval.java b/src/fr/inrialpes/exmo/align/util/GroupEval.java index 426c58b5..8108ea43 100644 --- a/src/fr/inrialpes/exmo/align/util/GroupEval.java +++ b/src/fr/inrialpes/exmo/align/util/GroupEval.java @@ -93,26 +93,26 @@ $Id$ public class GroupEval { - static Parameters params = null; - static String filename = null; - static String reference = "refalign.rdf"; - static String format = "pr"; - static int fsize = 2; - static String type = "html"; - static boolean embedded = false; - static String dominant = "s"; - static Vector listAlgo = null; - static int debug = 0; - static String color = null; - static Hashtable loaded = null; - static String ontoDir = null; + Parameters params = null; + String filename = null; + String reference = "refalign.rdf"; + String format = "pr"; + int fsize = 2; + String type = "html"; + boolean embedded = false; + String dominant = "s"; + Vector listAlgo = null; + int debug = 0; + String color = null; + Hashtable loaded = null; + String ontoDir = null; public static void main(String[] args) { - try { run( args ); } + try { new GroupEval().run( args ); } catch (Exception ex) { ex.printStackTrace(); }; } - public static void run(String[] args) throws Exception { + public void run(String[] args) throws Exception { String listFile = ""; LongOpt[] longopts = new LongOpt[10]; loaded = new Hashtable(); @@ -196,7 +196,7 @@ public class GroupEval { print( iterateDirectories() ); } - public static Vector iterateDirectories (){ + public Vector iterateDirectories (){ Vector result = null; File [] subdir = null; try { @@ -228,7 +228,7 @@ public class GroupEval { return result; } - public static Vector iterateAlignments ( File dir ) { + public Vector iterateAlignments ( File dir ) { String prefix = dir.toURI().toString()+"/"; Vector result = new Vector(); boolean ok = false; @@ -255,7 +255,7 @@ public class GroupEval { else return (Vector)null; } - public static Evaluator eval( String alignName1, String alignName2 ) { + public Evaluator eval( String alignName1, String alignName2 ) { Evaluator eval = null; try { int nextdebug; @@ -280,13 +280,13 @@ public class GroupEval { /** * This does not only print the results but compute the average as well */ - public static void print( Vector result ) { + public void print( Vector result ) { if ( type.equals("html") ) printHTML( result ); else if ( type.equals("tex") ) printLATEX( result ); else if ( type.equals("triangle") ) printTRIANGLE( result ); } - public static void printTRIANGLE( Vector result ) { + public void printTRIANGLE( Vector result ) { // variables for computing iterative harmonic means int expected = 0; // expected so far int foundVect[]; // found so far @@ -369,10 +369,10 @@ public class GroupEval { System.out.println("\\end{document}"); } - public static void printLATEX( Vector result ) { + public void printLATEX( Vector result ) { } - public static void printHTML( Vector result ) { + public void printHTML( Vector result ) { // variables for computing iterative harmonic means int expected = 0; // expected so far int foundVect[]; // found so far @@ -543,7 +543,7 @@ public class GroupEval { // Borrowed and enhanced from // http://acm.sus.mcgill.ca/20020323/work/acm-19/B.j // What a pity that it is not in Java... (wait for 1.5) - public static void printFormat(PrintStream w, double f){ + public void printFormat(PrintStream w, double f){ // JE: Must add the test is the value is Not a number, print NaN. if ( f != f ) { w.print("NaN"); @@ -558,7 +558,7 @@ public class GroupEval { } } - public static void usage() { + public void usage() { System.out.println("usage: GroupEval [options]"); System.out.println("options are:"); System.out.println("\t--format=prfmot -r prfmot\tSpecifies the output order (precision/recall/fallout/f-measure/overall/time)"); diff --git a/src/fr/inrialpes/exmo/align/util/ParserPrinter.java b/src/fr/inrialpes/exmo/align/util/ParserPrinter.java index dfa71cca..bc446404 100644 --- a/src/fr/inrialpes/exmo/align/util/ParserPrinter.java +++ b/src/fr/inrialpes/exmo/align/util/ParserPrinter.java @@ -99,11 +99,11 @@ $Id$ public class ParserPrinter { public static void main(String[] args) { - try { run( args ); } + try { new ParserPrinter().run( args ); } catch (Exception ex) { ex.printStackTrace(); }; } - public static void run(String[] args) throws Exception { + public void run(String[] args) throws Exception { Alignment result = null; String initName = null; String filename = null; @@ -220,7 +220,7 @@ public class ParserPrinter { } } - public static void usage() { + public void usage() { System.out.println("usage: ParserPrinter [options] URI"); System.out.println("options are:"); //System.out.println("\t--alignment=filename -a filename Start from an XML alignment file"); diff --git a/src/fr/inrialpes/exmo/align/util/Procalign.java b/src/fr/inrialpes/exmo/align/util/Procalign.java index 36d81752..6a209ee5 100644 --- a/src/fr/inrialpes/exmo/align/util/Procalign.java +++ b/src/fr/inrialpes/exmo/align/util/Procalign.java @@ -103,16 +103,16 @@ $Id$ public class Procalign { - static Hashtable loadedOntologies = null; + Hashtable loadedOntologies = null; - static OWLRDFErrorHandler handler = null; + OWLRDFErrorHandler handler = null; public static void main(String[] args) { - try { run( args ); } - catch (Exception ex) { ex.printStackTrace(); }; + try { new Procalign().run( args ); } + catch ( Exception ex ) { ex.printStackTrace(); }; } - public static Alignment run(String[] args) throws Exception { + public Alignment run(String[] args) throws Exception { OWLOntology onto1 = null; OWLOntology onto2 = null; AlignmentProcess result = null; @@ -333,7 +333,7 @@ public class Procalign { return result; } - public static OWLOntology loadOntology(URI uri) + public OWLOntology loadOntology(URI uri) throws ParserException, OWLException { OWLOntology parsedOnt = null; OWLRDFParser parser = new OWLRDFParser(); @@ -344,7 +344,7 @@ public class Procalign { return parsedOnt; } - public static void usage() { + public void usage() { System.err.println("usage: Procalign [options] URI1 URI2"); System.err.println("options are:"); System.err.println("\t--impl=className -i classname\t\tUse the given alignment implementation."); -- GitLab