?? main.java
字號:
/*
* Main.java
*
* Created on 2007年8月25日, 下午1:11
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package xrffconverter;
import java.io.FilenameFilter;
import weka.core.converters.ConverterUtils.DataSource;
import weka.core.converters.XRFFSaver;
import weka.core.Instances;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import xrffconverter.Converter;
/**
*
* @author Peng
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Converter aConverter = new Converter(args); // get an instance of Converter class
if(args.length==0){ //if no argument here, convert files in current dir
File home = new File(".");
String currentDir = home.getAbsolutePath().substring(0,home.getAbsolutePath().length()-1); //get absolute current dir
System.out.println("Current home directory is "+ currentDir);
System.out.println("");
try {
aConverter.convertDirs(currentDir, currentDir, currentDir); //invode method in aConverter to convert files in the current dir
} catch (Exception ex) {
ex.printStackTrace();
}
}else if (args.length==3){ // if 3 arguments here
File arg1= new File(args[0]);
File arg2= new File(args[1]);
File arg3= new File(args[2]);
if(arg1.isFile() && arg2.isFile()){ //if they are files, then convert these files
try {
aConverter.convertFiles(args[0],args[1],args[2]);
} catch (Exception ex) {
ex.printStackTrace();
}
}else if(arg1.isDirectory() && arg2.isDirectory() && arg3.isDirectory()){ // if they are dirs, then check the dirs and convert files in these dirs
try {
aConverter.convertDirs(args[0], args[1], args[2]);
} catch (Exception ex) {
ex.printStackTrace();
}
}else{
System.out.println("Error");
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -