Quickstart >> Conception complète d'une lentille >> Etape 1
Index - David Fauthoux

 

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

 

<<
Etape suivante>>