Skip to content

Instantly share code, notes, and snippets.

@becurt
Forked from skRyo/Main.java
Created October 10, 2012 11:15
Show Gist options
  • Save becurt/3864873 to your computer and use it in GitHub Desktop.
Save becurt/3864873 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/becurt/Documents/workspace/sekine/src/Main.java");
//↓コンソールから入力する場合
//File javaFile = new File(args[0]);
FileAnalyze fa = new FileAnalyze(javaFile);
//結果出力
//全ライン数
System.out.println("全ライン数 : " + fa.getLineCnt() + "件");
//実コードライン数
System.out.println("実コードライン数 : " + fa.getStepCnt() + "件");
//コメントライン数
System.out.println("コメントライン数 : " + fa.getCommentCnt() + "件");
//空白ライン数
System.out.println("空白ライン数 : " + fa.getSpaceLineCnt() + "件");
}
}
@becurt
Copy link
Author

becurt commented Oct 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment