gpt4 book ai didi

org.mozilla.zest.core.v1.ZestLoopTokenSet.getToken()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:33:41 27 4
gpt4 key购买 nike

本文整理了Java中org.mozilla.zest.core.v1.ZestLoopTokenSet.getToken()方法的一些代码示例,展示了ZestLoopTokenSet.getToken()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestLoopTokenSet.getToken()方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestLoopTokenSet
类名称:ZestLoopTokenSet
方法名:getToken

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));
    }
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com