gpt4 book ai didi

org.mozilla.zest.core.v1.ZestLoopFile类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:36:30 26 4
gpt4 key购买 nike

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

ZestLoopFile介绍

[英]This class represent a loop through a list of strings given in input through a file.
[中]此类表示通过文件输入中给定的字符串列表的循环。

代码示例

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

@Override
public ZestLoopFile deepCopy() {
  ZestLoopFile copy;
  try {
    copy = new ZestLoopFile(this.getIndex());
    copy.setVariableName(this.getVariableName());
    copy.setCurrentState(this.getCurrentState().deepCopy());
    copy.setStatements(this.copyStatements());
    copy.setSet(this.getSet().deepCopy());
    copy.setEnabled(this.isEnabled());
    return copy;
  } catch (IOException e) {
    e.printStackTrace();
  }
  return null;
}

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

@Override
public String getCurrentToken() {
  if (super.getCurrentToken() == null) {
    super.init(getSet(), getStatements());
  }
  return super.getCurrentToken();
}

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

@Override
public void toLastState() {
  getCurrentState().toLastState(getSet());
}

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

@Test
  public void testLoop() throws Exception {
    ZestScript script = new ZestScript();
    ZestLoopFile loop = new ZestLoopFile();
    loop.setVariableName("aaa");

    script.add(loop);

    Set<String> vars = script.getVariableNames();

    assertTrue(vars.contains("aaa"));
  }
}

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

@Test
  public void testSerializationLoopFile() throws FileNotFoundException {
    ZestLoopFile loop = new ZestLoopFile(ZestLoopFileUnitTest.file.getAbsolutePath());
    for (ZestStatement stmt : statements) {
      loop.addStatement(stmt);
    }
    String loopString = ZestJSON.toString(loop);
    ZestLoopFile copy = (ZestLoopFile) ZestJSON.fromString(loopString);
    String copyString = ZestJSON.toString(copy);
    // System.out.println("===============================");
    // System.out.println("           LOOP FILE");
    // System.out.println("===============================");
    // System.out.println(copyString);
    assertTrue(loopString.equals(copyString));
  }
}

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

/**
   * Method testOpenFile.
   *
   * @throws IOException
   */
  @Test
  public void testOpenFile() throws IOException {
    new ZestLoopFile(file.getAbsolutePath());
  }
}

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

/**
 * returns the file of this loop.
 *
 * @return the file of this loop
 */
public File getFile() {
  return this.getSet().getFile();
}

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

@Override
public void setSet(ZestLoopTokenSet<String> set) {
  if (set instanceof ZestLoopTokenFileSet) {
    try {
      ZestLoopTokenFileSet fileSet = (ZestLoopTokenFileSet) set;
      this.set = new ZestLoopTokenFileSet(fileSet.getFile().getAbsolutePath());
      super.init(set, getStatements());
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
  } else {
    throw new IllegalArgumentException(
        "Invelid set. It must be instance of " + ZestLoopTokenFileSet.class.getName());
  }
}

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

ZestLoopFile loopFile = (ZestLoopFile) loop;
  System.out.println(
      "FOR tokens IN FILE " + loopFile.getFile().getAbsolutePath() + " DO");
} else if (stmt instanceof ZestLoopInteger) {
  ZestLoopInteger loopInteger = (ZestLoopInteger) loop;

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

System.out.println("    ZestLoopFile");
System.out.println("---------------------");
ZestLoopFile loopFile = new ZestLoopFile(ZestLoopFileUnitTest.file.getAbsolutePath());
for (ZestStatement stmt : statements) {
  loopFile.addStatement(stmt);

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

public static void main(String[] args) throws FileNotFoundException {
  ZestLoopFile loop = new ZestLoopFile(ZestLoopFileUnitTest.file.getAbsolutePath());
  ZestScript script =
      new ZestScript(

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

public boolean loop() {
  return super.loop(getSet());
}

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

public void endLoop() {
    super.endLoop(getSet());
  }
}

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

@Override
public void increase() {
  super.getCurrentState().increase(getSet());
}

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

@Override
public boolean isLastState() {
  return super.getCurrentState().isLastState(getSet());
}

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