本文整理了Java中org.mozilla.zest.core.v1.ZestLoopTokenStringSet.getToken()
方法的一些代码示例,展示了ZestLoopTokenStringSet.getToken()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestLoopTokenStringSet.getToken()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestLoopTokenStringSet
类名称:ZestLoopTokenStringSet
方法名:getToken
[英]returns the tokens of this Set
[中]返回此集合的标记
代码示例来源:origin: mozilla/zest
@Override
public String getToken(int index) {
try {
return this.getConvertedSet().getToken(index);
} catch (ZestClientFailException e) {
return null;
}
}
代码示例来源:origin: mozilla/zest
@Override
public String getToken(int index) {
try {
return this.getConvertedSet().getToken(index);
} catch (ZestClientFailException e) {
return null;
}
}
代码示例来源:origin: mozilla/zest
@Override
public String getToken(int index) {
return this.getConvertedSet().getToken(index);
}
代码示例来源:origin: mozilla/zest
/**
* Gets the values.
*
* @return the values
*/
public String[] getValues() {
ZestLoopTokenStringSet set = this.getSet();
String[] array = new String[set.size()];
for (int i = 0; i < array.length; i++) {
array[i] = set.getToken(i);
}
return array;
}
代码示例来源: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
@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 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
ZestLoopTokenStringSet set = loopString.getSet();
for (int i = 0; i < set.size() - 1; i++) {
System.out.print(set.getToken(i) + ",");
System.out.println(set.getToken(set.size() - 1) + "] DO");
} else if (stmt instanceof ZestLoopFile) {
ZestLoopFile loopFile = (ZestLoopFile) loop;
代码示例来源: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);
}
内容来源于网络,如有侵权,请联系作者删除!