本文整理了Java中org.mozilla.zest.core.v1.ZestLoopTokenSet.getToken()
方法的一些代码示例,展示了ZestLoopTokenSet.getToken()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestLoopTokenSet.getToken()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestLoopTokenSet
类名称:ZestLoopTokenSet
方法名:getToken
[英]returns the token at a given index.
[中]返回给定索引处的标记。
代码示例来源:origin: mozilla/zest
/**
* main construptor.
*
* @param initializationTokenSet the set of token and the fisrt value to consider inside the
* loop
*/
protected ZestLoopState(ZestLoopTokenSet<T> initializationTokenSet) {
if (initializationTokenSet == null) {
throw new IllegalArgumentException("a null token set is not allowed");
}
if (initializationTokenSet.size() > 0) {
this.currentToken = initializationTokenSet.getToken(0);
this.currentIndex = 0;
}
}
代码示例来源:origin: mozilla/zest
@Override
public boolean increase(ZestLoopTokenSet<String> set) {
this.increaseIndex();
if (this.getCurrentIndex() >= set.size()) {
this.setCurrentToken(null);
} else {
this.setCurrentToken(set.getToken(getCurrentIndex()));
}
return true;
}
代码示例来源: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));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!