01: package org.drools.brms.client.modeldriven.brl;
02:
03: /**
04: * This represents a DSL sentence.
05: * @author Michael Neale
06: */
07: public class DSLSentence implements IPattern, IAction {
08:
09: public String sentence;
10:
11: /**
12: * This will strip off any residual "{" stuff...
13: */
14: public String toString() {
15: final char[] chars = this .sentence.toCharArray();
16: String result = "";
17: for (int i = 0; i < chars.length; i++) {
18: final char c = chars[i];
19: if (c != '{' && c != '}') {
20: result += c;
21: }
22: }
23: return result;
24: }
25:
26: /**
27: * This is used by the GUI when adding a sentence to LHS or RHS.
28: * @return
29: */
30: public DSLSentence copy() {
31: final DSLSentence newOne = new DSLSentence();
32: newOne.sentence = this.sentence;
33: return newOne;
34: }
35: }
|