|
GNU Prolog for Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
java.io.PrintWriter
gnu.prolog.io.TermWriter
public class TermWriter
This class is intendent for printing terms.
Field Summary | |
---|---|
protected static CompoundTermTag |
curly1Tag
|
protected static OperatorSet |
defaultOperatorSet
|
protected static WriteOptions |
defaultWriteOptions
|
protected static CompoundTermTag |
numbervarsTag
|
Fields inherited from class java.io.PrintWriter |
---|
out |
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
TermWriter(Writer w)
create term writer over other writer. |
Method Summary | |
---|---|
protected static void |
appendQuotedChar(StringBuffer buf,
char ch,
char quote)
append quoted char to string buffer. |
protected void |
displayAtom(WriteOptions options,
AtomTerm atom)
display atom. |
protected void |
displayCompound(WriteOptions options,
int priority,
CompoundTerm term)
display compound term |
protected void |
displayFloat(WriteOptions options,
FloatTerm term)
display float term |
protected void |
displayInteger(WriteOptions options,
IntegerTerm term)
display integer term |
protected void |
displayJavaObject(WriteOptions options,
JavaObjectTerm term)
|
protected void |
displayList(WriteOptions options,
CompoundTerm term)
display list |
protected void |
displayTerm(WriteOptions options,
int priority,
Term term)
display term |
protected void |
displayVariable(WriteOptions options,
VariableTerm variable)
display variable term |
protected static String |
getSingleQuoted(String s)
get single quoted string. |
protected static boolean |
isAtomChar(char c)
check if character is valid continuation of atom. |
protected static boolean |
isAtomStartChar(char c)
check if character is valid start of atom. |
protected static boolean |
isGraphicsChar(char ch)
check if character is graphics char. |
protected static boolean |
isOperator(OperatorSet set,
AtomTerm term)
|
protected static boolean |
isSoloChar(char c)
check if character is solo char. |
protected static boolean |
needBeQuoted(String s)
check if the string is needed to be quoted . |
void |
print(OperatorSet opSet,
Term term)
print term using default write options and specified operator set |
void |
print(Term term)
print term using default write options |
void |
print(WriteOptions options,
Term term)
print term using specified write options |
static String |
toString(Term term)
convert term passed as argument to string |
static String |
toString(Term term,
WriteOptions options)
convert term passed as argument to string |
Methods inherited from class java.io.PrintWriter |
---|
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final CompoundTermTag numbervarsTag
protected static final CompoundTermTag curly1Tag
protected static final OperatorSet defaultOperatorSet
protected static final WriteOptions defaultWriteOptions
Constructor Detail |
---|
public TermWriter(Writer w)
w
- underlying writerMethod Detail |
---|
public static String toString(Term term)
term
- a term to convert
public static String toString(Term term, WriteOptions options)
term
- a term to convertoptions
- the WriteOptions to use for converting the term to a String
public void print(WriteOptions options, Term term)
options
- write optionsterm
- term to printpublic void print(Term term)
term
- term to printpublic void print(OperatorSet opSet, Term term)
opSet
- operator set to useterm
- term to printprotected void displayTerm(WriteOptions options, int priority, Term term)
options
- current write optionspriority
- priority of nearest operation, this variable is only defined if
ignoreOps is false.term
- term to writeprotected void displayCompound(WriteOptions options, int priority, CompoundTerm term)
options
- current write optionspriority
- priority of nearest operation, this variable is only defined if
ignoreOps is false.term
- compound term to writeprotected void displayList(WriteOptions options, CompoundTerm term)
options
- current write optionsterm
- list term to writeprotected void displayFloat(WriteOptions options, FloatTerm term)
options
- current write optionsterm
- fload term to writeprotected void displayInteger(WriteOptions options, IntegerTerm term)
options
- current write optionsterm
- integer term to writeprotected void displayVariable(WriteOptions options, VariableTerm variable)
options
- current write optionsvariable
- variable to displayprotected void displayJavaObject(WriteOptions options, JavaObjectTerm term)
protected static boolean isOperator(OperatorSet set, AtomTerm term)
protected void displayAtom(WriteOptions options, AtomTerm atom)
options
- current write optionsatom
- atom to displayprotected static String getSingleQuoted(String s)
s
- string to quote
protected static boolean needBeQuoted(String s)
s
- string to test
protected static boolean isSoloChar(char c)
c
- character to test
protected static boolean isGraphicsChar(char ch)
ch
- character to test
protected static boolean isAtomStartChar(char c)
c
- character to test
protected static boolean isAtomChar(char c)
c
- character to test
protected static void appendQuotedChar(StringBuffer buf, char ch, char quote)
buf
- buffer to which character is addedch
- character to addquote
- a quote of string
|
GNU Prolog for Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |