Class CSVPath

All Implemented Interfaces:
IPath<Integer>

public class CSVPath extends AbstractPath<Integer>
最小限のCSVPath実装

CSV列選択のパス一致判定のみに特化したシンプルな設計

複数の列セレクターをOR条件で判定する機能を提供

  • Constructor Details

    • CSVPath

      public CSVPath(String selector)
      単一セレクターでCSVPathを作成
      Parameters:
      selector - 列選択子(列名または数値インデックス)
      Throws:
      IllegalArgumentException - セレクターが不正な場合
    • CSVPath

      public CSVPath(List<String> selectorList)
      複数セレクターでCSVPathを作成(OR条件)
      Parameters:
      selectorList - 列選択子のリスト
      Throws:
      IllegalArgumentException - セレクターが不正な場合
  • Method Details

    • validateAndNormalize

      protected void validateAndNormalize(String rawSelector)
      Description copied from class: AbstractPath
      パス文字列の検証と正規化
      Specified by:
      validateAndNormalize in class AbstractPath<Integer>
      Parameters:
      rawSelector - 生のパス文字列
    • matches

      public boolean matches(Integer columnIndex)
      Description copied from interface: IPath
      指定されたコンテキストがこのパスにマッチするか判定
      Parameters:
      columnIndex - 判定対象のコンテキスト
      Returns:
      マッチする場合true
    • matches

      public boolean matches(String[] headers, int targetIndex)
      列ヘッダー配列との一致判定(OR条件)
      Parameters:
      headers - CSV列ヘッダー配列
      targetIndex - 対象列のインデックス
      Returns:
      いずれかのセレクターが一致する場合true
    • findMatchingIndices

      public List<Integer> findMatchingIndices(String[] headers)
      マッチするすべての列インデックスを取得(Don't Ask Tell準拠)
      Parameters:
      headers - CSV列ヘッダー配列
      Returns:
      マッチした列インデックスのリスト
    • findMatchingIndices

      public List<Integer> findMatchingIndices(int totalColumns)
      マッチするすべての列インデックスを取得(ヘッダーなしの場合)
      Parameters:
      totalColumns - 総列数
      Returns:
      マッチした列インデックスのリスト
    • toString

      public String toString()
      Overrides:
      toString in class Object