本文整理了Java中org.mozilla.zest.core.v1.ZestLoopTokenStringSet.<init>()
方法的一些代码示例,展示了ZestLoopTokenStringSet.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestLoopTokenStringSet.<init>()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestLoopTokenStringSet
类名称:ZestLoopTokenStringSet
方法名:<init>
[英]Instantiates a new zest loop token string set.
[中]实例化一个新的zest循环令牌字符串集。
代码示例来源:origin: mozilla/zest
/**
* Instantiates a new zest loop state string.
*
* @param values the values
*/
public ZestLoopStateString(String[] values) {
this(new ZestLoopTokenStringSet(values));
}
代码示例来源:origin: mozilla/zest
@Override
public ZestLoopTokenStringSet deepCopy() {
if (this.tokens == null) {
return new ZestLoopTokenStringSet();
}
ZestLoopTokenStringSet copy = new ZestLoopTokenStringSet();
for (String token : this.tokens) {
copy.addToken(token);
}
return copy;
}
代码示例来源:origin: mozilla/zest
/** Instantiates a new zest loop string. */
public ZestLoopString() {
super();
this.set = new ZestLoopTokenStringSet();
super.init(set, new LinkedList<ZestStatement>());
}
代码示例来源:origin: mozilla/zest
/**
* Instantiates a new zest loop string.
*
* @param index the index of the statement loop.
*/
public ZestLoopString(int index) {
super(index);
this.set = new ZestLoopTokenStringSet();
super.init(set, new LinkedList<ZestStatement>());
}
代码示例来源:origin: mozilla/zest
/**
* Instantiates a new zest loop string.
*
* @param values the values
*/
public ZestLoopString(String[] values) {
super();
this.set = new ZestLoopTokenStringSet(values);
super.init(set, new LinkedList<ZestStatement>());
}
代码示例来源:origin: mozilla/zest
/**
* Instantiates a new zest loop string.
*
* @param index the index of the statement
* @param values the values
*/
public ZestLoopString(int index, String[] values) {
super(index);
this.set = new ZestLoopTokenStringSet(values);
super.init(set, new LinkedList<ZestStatement>());
}
代码示例来源:origin: mozilla/zest
/**
* private method for initialization of the loop (TokenSet & first state).
*
* @param file the file
* @return the zest loop token string set
* @throws FileNotFoundException if the file does not exist
*/
private ZestLoopTokenStringSet getConvertedSet(File file) throws FileNotFoundException {
if (this.convertedSet == null) {
try (Scanner in = new Scanner(file)) {
ZestLoopTokenStringSet initializationSet = new ZestLoopTokenStringSet();
String line;
while (in.hasNextLine()) {
line = in.nextLine();
if (!line.startsWith("#")
&& !line.isEmpty()) { // discards commented and empty line
initializationSet.addToken(line);
}
}
this.convertedSet = initializationSet;
}
}
return convertedSet;
}
代码示例来源:origin: mozilla/zest
/**
* Instantiates a new zest loop string.
*
* @param name the name
* @param values the values
*/
public ZestLoopString(String name, String[] values) {
super();
this.set = new ZestLoopTokenStringSet(values);
super.setVariableName(name);
super.init(set, new LinkedList<ZestStatement>());
}
代码示例来源:origin: mozilla/zest
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet();
Pattern pattern;
代码示例来源:origin: mozilla/zest
@Test
public void testZestLoopTokenSetString() {
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet();
assertFalse(set.getTokens() == null);
}
代码示例来源:origin: mozilla/zest
@Test
public void testReplace() {
int indexOfReplace = 2;
String valueOfNewToken = "CHANGED";
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet(arrayValueS);
String newToken = valueOfNewToken;
set.replace(indexOfReplace, newToken);
assertTrue(set.getToken(indexOfReplace).equals(valueOfNewToken));
}
代码示例来源:origin: mozilla/zest
@Test
public void testGetToken() {
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet(arrayValueS);
for (int i = 0; i < arrayValueS.length; i++) {
String msg = i + " expected " + arrayValueS[i] + ", obtained " + set.getToken(i);
assertTrue(msg, arrayValueS[i].equals(set.getToken(i)));
}
}
代码示例来源:origin: mozilla/zest
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet();
代码示例来源:origin: mozilla/zest
@Test
public void testIndexOf() {
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet(arrayValueS);
int indexConsidered = 3;
String token = set.getToken(indexConsidered);
int indexFound = set.indexOf(token);
assertTrue(indexFound == indexConsidered);
}
代码示例来源:origin: mozilla/zest
@Test
public void testDeepCopy() {
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet(arrayValueS);
ZestLoopTokenSet<String> copy = set.deepCopy();
for (int i = 0; i < set.size(); i++) {
String expected = set.getToken(i);
String obtained = copy.getToken(i);
String msg = i + " obtained " + obtained + " instead of " + expected;
assertTrue(msg, expected.equals(obtained));
}
}
}
代码示例来源:origin: mozilla/zest
@Test
public void testSize() {
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet(arrayValueS);
int prevSize = set.size();
set.addToken("ernvgqiup");
assertTrue(prevSize == arrayValueS.length && set.size() == prevSize + 1);
}
代码示例来源:origin: mozilla/zest
@Test
public void testRemoveToken() {
ZestLoopTokenStringSet set = new ZestLoopTokenStringSet(arrayValueS);
String tokenRemoved = set.getToken(0);
boolean isPresentBeforeRemove = set.indexOf(tokenRemoved) >= 0;
set.removeToken(0);
assertTrue(isPresentBeforeRemove && set.indexOf(tokenRemoved) < 0);
}
内容来源于网络,如有侵权,请联系作者删除!