Package jp.sf.amateras.stepcounter

Examples of jp.sf.amateras.stepcounter.CountResult


    sb.append(makeHyphen(maxFileLength));
    sb.append("--------------------------------------------------");
    sb.append("\n");
    // �P�s���������s��
    for(int i=0;i<results.length;i++){
      CountResult result = results[i];
      // ���Ή��̃J�E���g���ʂ��t�H�[�}�b�g
      if(result.getFileType()==null){
        sb.append(fillOrCut(result.getFileName(), maxFileLength));
        sb.append("���Ή�");
        sb.append("\n");
      // ����ɃJ�E���g���ꂽ���ʂ��t�H�[�}�b�g
      } else {
//        String fileName = result.getFileName();
//        String fileType = result.getFileType();
        String step     = String.valueOf(result.getStep());
        String non      = String.valueOf(result.getNon());
        String comment  = String.valueOf(result.getComment());
        String sum      = String.valueOf(result.getStep() + result.getNon() + result.getComment());

        sb.append(fillOrCut(result.getFileName(), maxFileLength));
        sb.append(fillOrCut(result.getFileType(), 6));
        sb.append(fillOrCut(result.getCategory(),20));
        sb.append(leftFillOrCut(step    , 6));
        sb.append(leftFillOrCut(non     , 6));
        sb.append(leftFillOrCut(comment , 6));
        sb.append(leftFillOrCut(sum     , 6));
        sb.append("\n");

        sumStep    += result.getStep();
        sumComment += result.getComment();
        sumNone    += result.getNon();
      }
    }
    // ���v�s���t�H�[�}�b�g
    sb.append(makeHyphen(maxFileLength));
    sb.append("--------------------------------------------------");
View Full Code Here


//  private String sumHeader     = "���v";

  public byte[] format(CountResult[] results){
    StringBuffer sb = new StringBuffer();
    for(int i=0;i<results.length;i++){
      CountResult result = results[i];
      // ���Ή��̌`�����t�H�[�}�b�g
      if(result.getFileType()==null){
        sb.append(result.getFileName());
        sb.append(",");
        sb.append("���Ή�");
        sb.append(",");
        sb.append(",");
        sb.append(",");
        sb.append(",");
        sb.append(",");
        sb.append("\n");
      // ����ɃJ�E���g���ꂽ���̂��t�H�[�}�b�g
      } else {
        sb.append(result.getFileName());
        sb.append(",");
        sb.append(result.getFileType());
        sb.append(",");
        sb.append(result.getCategory());
        sb.append(",");
        sb.append(result.getStep());
        sb.append(",");
        sb.append(result.getNon());
        sb.append(",");
        sb.append(result.getComment());
        sb.append(",");
        sb.append(result.getStep()+result.getNon()+result.getComment());
        sb.append("\n");
      }
    }
    return sb.toString().getBytes();
  }
View Full Code Here

        }

            for (String name : ds.getIncludedFiles()) {
              File file = new File(baseDir, name);
              try {
                CountResult result = count(file);
                if (showDirectory) {
                  name = file.getCanonicalPath();
                  if (name.startsWith(basePath)) {
                    name = name.substring(basePath.length());
                  }
                  name = name.replace('\\', '/');
                  result.setFileName(name);
                }
                if (directoryAsCategory) {
                  result.setCategory(baseDir.getName());
                }
              results.add(result);
              } catch (IOException e) {
                        if (failonerror) {
                          throw new BuildException("I/O Error: " + file, e);
View Full Code Here

    private CountResult count(File file) throws IOException {
    StepCounter counter = StepCounterFactory.getCounter(file.getName());
    if (counter != null) {
      return counter.count(file, Util.getFileEncoding(file));
    } else {
      return new CountResult(file, file.getName(), null, null, 0, 0, 0);
    }
    }
View Full Code Here

TOP

Related Classes of jp.sf.amateras.stepcounter.CountResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.