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

x33g5p2x  于2022-02-05 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(69)

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

ZestLoopTokenStringSet.size介绍

暂无

代码示例

代码示例来源:origin: mozilla/zest

@Override
public int size() {
  try {
    return this.getConvertedSet().size();
  } catch (ZestClientFailException e) {
    return -1;
  }
}

代码示例来源:origin: mozilla/zest

@Override
public int size() {
  try {
    return this.getConvertedSet().size();
  } catch (ZestClientFailException e) {
    return -1;
  }
}

代码示例来源:origin: mozilla/zest

@Override
public int size() {
  return this.getConvertedSet().size();
}

代码示例来源: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 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 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 testZestLoopStringStringArrayIntListOfZestStatement() {
  LinkedList<ZestStatement> statements = new LinkedList<>();
  int firstIndex = 3;
  for (int i = 0; i < firstIndex - 1; i++) {
    statements.add(new ZestConditional(i));
  }
  statements.add(new ZestLoopString(firstIndex, values));
  ZestLoopString loop = new ZestLoopString(firstIndex, values);
  int idx = 0;
  for (ZestStatement stmt : statements) {
    loop.addStatement(stmt);
    idx = stmt.getIndex();
  }
  boolean rightStmtPos = loop.getStatement(idx).getClass().equals(ZestLoopString.class);
  boolean rightSetSize = loop.getSet().size() == values.length;
  assertTrue("right statements position", rightStmtPos);
  assertTrue("right Set Size", rightSetSize);
}

代码示例来源:origin: mozilla/zest

System.out.print("FOR tokens IN [");
  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 testIsLastState() {
    ZestLoopStateString state = new ZestLoopStateString(set);
    for (int i = 0; i < 13; i++) {
      state.increase(set);
      if (state.getCurrentIndex() == set.size()) {
        assertTrue(state.isLastState(set));
        break;
      }
    }
  }
}

相关文章