Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.amcgala.framework.shape.util.lsystem;
 
 import java.util.Map;

Die Ersetzungsregeln eines LindenmayerSystem.

Author(s):
Robert Giacinto
Since:
2.0
public class Rules {
    private Map<StringStringreplacementRules;
    private Map<StringStringdrawingRules;
    public Rules() {
         = new HashMap<StringString>(15);
         = new HashMap<StringString>(15);
    }
    public Rules addReplacementRule(String symbolString replacement) {
        .put(symbolreplacement);
        return this;
    }
    public Rules addDrawingRule(String symbolString replacement) {
        .put(symbolreplacement);
        return this;
    }
    public String applyReplacementRules(String symbol) {
        return .containsKey(symbol) ? .get(symbol) : symbol;
    }
    public String applyDrawingRules(String symbol) {
        return .containsKey(symbol) ? .get(symbol) : symbol;
    }
New to GrepCode? Check out our FAQ X