|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjess.PrettyPrinter
A PrettyPrinter knows how to format various Jess constructs for display. Used in the implementation of the "ppdefrule" command and such.
This class can produce a formatted
rendering of many Jess objects, including Defrules,
Deffunctions Defquerys, etc -- anything
that implements the Visitable interface.
toString() to get the formatted
result.
Rete r = new Rete();
r.eval("(defrule myrule (A) => (printout t \"A\" crlf))");
Defrule dr = (Defrule) r.findDefrule("myrule");
System.out.println(new PrettyPrinter(dr));
The above code produces the following output:
(defrule MAIN::myrule (MAIN::A) => (printout t "A" crlf))(C) 2005 Sandia National Laboratories
Visitable| Constructor Summary | |
PrettyPrinter(Visitable v)
Construct a PrettyPrinter for the given object. |
|
| Method Summary | |
java.lang.String |
toString()
Returns the rendered version of the constructor argument. |
java.lang.Object |
visitAccumulate(Accumulate accumulate)
|
java.lang.Object |
visitDeffacts(Deffacts facts)
|
java.lang.Object |
visitDeffunction(Deffunction func)
|
java.lang.Object |
visitDefglobal(Defglobal global)
|
java.lang.Object |
visitDefmodule(Defmodule defmodule)
|
java.lang.Object |
visitDefquery(Defquery query)
|
java.lang.Object |
visitDefrule(Defrule rule)
|
java.lang.Object |
visitDeftemplate(Deftemplate template)
|
java.lang.Object |
visitGroup(Group g)
|
java.lang.Object |
visitPattern(Pattern p)
|
java.lang.Object |
visitTest1(Test1 t)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PrettyPrinter(Visitable v)
v - the object to be rendered| Method Detail |
public java.lang.Object visitDeffacts(Deffacts facts)
visitDeffacts in interface Visitorpublic java.lang.Object visitDeftemplate(Deftemplate template)
visitDeftemplate in interface Visitorpublic java.lang.Object visitDefglobal(Defglobal global)
visitDefglobal in interface Visitorpublic java.lang.Object visitDeffunction(Deffunction func)
visitDeffunction in interface Visitorpublic java.lang.Object visitDefrule(Defrule rule)
visitDefrule in interface Visitorpublic java.lang.Object visitGroup(Group g)
visitGroup in interface Visitorpublic java.lang.Object visitPattern(Pattern p)
visitPattern in interface Visitorpublic java.lang.Object visitTest1(Test1 t)
visitTest1 in interface Visitorpublic java.lang.Object visitAccumulate(Accumulate accumulate)
visitAccumulate in interface Visitorpublic java.lang.Object visitDefmodule(Defmodule defmodule)
visitDefmodule in interface Visitorpublic java.lang.Object visitDefquery(Defquery query)
visitDefquery in interface Visitorpublic java.lang.String toString()
|
© 2006 Sandia Corporation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||