Skip to content

Instantly share code, notes, and snippets.

@skRyo
Created October 9, 2012 16:26
Show Gist options
  • Save skRyo/3859872 to your computer and use it in GitHub Desktop.
Save skRyo/3859872 to your computer and use it in GitHub Desktop.
import java.io.File;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//解析対象ファイル
File javaFile = new File("/Users/ryo/Documents/workspace/CountjavaFile/src/test.java");
//↓コンソールから入力する場合
//File javaFile = new File(args[0]);
FileAnalyze FileAnalyze = new FileAnalyze(javaFile);
//結果出力
//全ライン数
System.out.println("全ライン数 : " + StepCount.getAllStep() + "件");
//実コードライン数
System.out.println("実コードライン数 : " + StepCount.getCodeStep() + "件");
//コメントライン数
System.out.println("コメントライン数 : " + StepCount.getCommentStep() + "件");
//空白ライン数
System.out.println("空白ライン数 : " + StepCount.getEmptyStep() + "件");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment