View Javadoc
1   package com.github.mygreen.supercsv.cellprocessor.conversion;
2   
3   /**
4    * 文字列をパディングする処理のインタフェース。
5    *
6    * @since 2.1
7    * @author T.TSUCHIE
8    *
9    */
10  public interface PaddingProcessor {
11  
12      /**
13       * テキストをパディングする
14       * @param text パディング対象の文字
15       * @param size サイズ
16       * @param padChar パディングする文字。
17       * @param rightAlign 右詰めするかどうか。
18       * @param chopped 処理対象の文字が固定長を超えている場合に、切り出すかどうか。
19       * @return パディングされた文字列
20       */
21      String pad(String text, int size, char padChar, boolean rightAlign, boolean chopped);
22  
23      /**
24       * 引数で指定した1文字分のコードポイントの文字数をカウントします。
25       * 
26       * @param codePoint コードポイント。
27       * @return カウントした文字数。
28       */
29      int count(int codePoint);
30      
31      /**
32       * 文字列の文字数をカウントする。
33       * 
34       * @param text カウント対象の文字列
35       * @return カウントした文字数
36       * @throws NullPointerException {@literal text is null.}
37       */
38      int count(String text);
39  
40  }