パッケージ com.kazurayam.unittest
クラス StringSequence
java.lang.Object
com.kazurayam.unittest.StringSequence
StringSequence.indexOfSubsequence() will return the index value at which the subsequence is
found in the sequence.
Given the sequence is ["Users", "me", "tmp", "selenium-webdriver-java", "selenium-webdriver-junit4", "build", "classes", "java", "test", "com", "kazurayam", "webdriver", "TestOutputOrganizer.class"],
and the subsequence is ["build", "classes", "java", "test"].
Then StringSequence.indexOfSubsequence(sequence, subsequence) should return 5.
The value 5 is the index value of the string "build" in the given sequence.
The value "build" the head of the subsequence.
Provided the returned value of indexOfSubsequence, I can get the sublist out of the sequence:
["Users", "me", "tmp", "selenium-webdriver-java", "selenium-webdriver-junit4"].
I can convert this string list into a valid Path:
/Users/me/tmp/selenium-webdriver-java/selenium-webdriver-junit
which is the absolute Path of the subproject's project directory.
Provided with this result, I can create a directory into which my test classes write output files.
/Users/me/tmp/selenium-webdriver-java/selenium-webdriver-junit/test-output
-
コンストラクタの概要
-
メソッドの概要
修飾子とタイプメソッド説明indexListOfSubsequence
(List<String> subsequence) Provided that the sequence = ["a", "b", "c", "d"] and the subsequence = ["b", "c"], then indexOfSubsequence(sequence, subsequence) returns 1, which is the index of "b" in the sequence List.indexOfSubsequence
(List<String> subsequence) returns the value equal to indexListOfSubsequence().get(0)toString()
-
コンストラクタの詳細
-
StringSequence
- パラメータ:
sequence
- List of Strings as target to scan
-
-
メソッドの詳細
-
indexOf
-
indexOfSubsequence
returns the value equal to indexListOfSubsequence().get(0)- パラメータ:
subsequence
- List of String as marker to look for- 戻り値:
- the index in the sequence where the subsequence is found. return -1 if not found.
-
indexListOfSubsequence
Provided that the sequence = ["a", "b", "c", "d"] and the subsequence = ["b", "c"], then indexOfSubsequence(sequence, subsequence) returns 1, which is the index of "b" in the sequence List. Provided that the sequence = ["a", "b", "c", "d"] and the subsequence = ["e"], then indexOfSubsequence(sequence, subsequence) returns -1 as "e" in not found in the sequence List. Provided that the sequence is- パラメータ:
subsequence
- List of String as marker to look for- 戻り値:
- the index in the sequence where the subsequence is found. return -1 if not found.
-
toString
-