com.github.dakusui.jcunit8.factorspace.fsm.Sequence Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcunit Show documentation
Show all versions of jcunit Show documentation
Automated combinatorial testing framework on top of JUnit
The newest version!
package com.github.dakusui.jcunit8.factorspace.fsm;
import java.util.AbstractList;
import java.util.LinkedList;
import java.util.List;
public interface Sequence extends List>, Stimulus {
class Impl extends AbstractList> implements Sequence {
private final List> edges;
Impl(List> edges) {
this.edges = edges;
}
@Override
public Edge get(int index) {
return edges.get(index);
}
@Override
public int size() {
return edges.size();
}
@Override
public void accept(Player player) {
player.visit(this);
}
}
class Builder {
protected final LinkedList> edges;
public Builder() {
this.edges = new LinkedList<>();
}
public Builder add(Edge edge) {
this.edges.add(edge);
return this;
}
public Builder addAll(List> edges) {
Builder.this.edges.addAll(edges);
return this;
}
public Sequence build() {
return new Impl<>(this.edges);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy