Coder la lentille VowelFilter appartenant à un flot StringInput.
import broad.string.input.StringInput;
import broad.util.CannotBeNullException;
public class VowelFilter implements StringInput {
private StringInput lensee;
public VowelFilter(StringInput lensee) {
if(lensee == null)
throw new CannotBeNullException(this, "lensee");
this.lensee = lensee;
}
public String getString() {
String s = lensee.getString();
if(s == null) return null;
return s.replaceAll("e", "y");
}
}
new VowelFilter filter
tie filter 0 string 0
tie stringDrawer 0 filter 0
run entry 0