Class TermWrapper
- java.lang.Object
-
- com.igormaznitsa.prologparser.terms.PrologTerm
-
- com.igormaznitsa.prologparser.terms.PrologCompound
-
- com.igormaznitsa.prologparser.terms.InternalSpecialCompoundTerm
-
- com.igormaznitsa.prologparser.tokenizer.TermWrapper
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<PrologTerm>
public final class TermWrapper extends InternalSpecialCompoundTerm
Internal term wrapper to build AST.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDprivate PrologTermwrappedTerm-
Fields inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
quotation, text
-
-
Constructor Summary
Constructors Constructor Description TermWrapper(PrologTerm term)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetArity()Arity of element.intgetPrecedence()Get precedence of the term.QuotationgetQuotation()Get quotation for the term.java.lang.StringgetText()Get the term text.TermTypegetType()Get term type.PrologTermgetWrappedTerm()java.lang.StringtoString()-
Methods inherited from class com.igormaznitsa.prologparser.terms.InternalSpecialCompoundTerm
compareTo, getTermAt, stream
-
Methods inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
assertNonEmptyString, findQuotation, flatComma, getFunctor, getLine, getPos, isAnyBlock, isBlock, isCurlyBlock, setLine, setPos
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
wrappedTerm
private final PrologTerm wrappedTerm
-
-
Constructor Detail
-
TermWrapper
public TermWrapper(PrologTerm term)
-
-
Method Detail
-
getArity
public int getArity()
Description copied from class:PrologTermArity of element.- Overrides:
getArityin classPrologTerm- Returns:
- arity of element, make sense for compound terms, for primitive terms is 1
-
getWrappedTerm
public PrologTerm getWrappedTerm()
-
getQuotation
public Quotation getQuotation()
Description copied from class:PrologTermGet quotation for the term.- Overrides:
getQuotationin classPrologTerm- Returns:
- the quotation for the term, must not be null
-
getType
public TermType getType()
Description copied from class:PrologTermGet term type.- Specified by:
getTypein classPrologTerm- Returns:
- term type, must not be null
-
getText
public java.lang.String getText()
Description copied from class:PrologTermGet the term text.- Overrides:
getTextin classPrologTerm- Returns:
- the term text, must not be null
-
getPrecedence
public int getPrecedence()
Description copied from class:PrologTermGet precedence of the term.- Overrides:
getPrecedencein classPrologTerm- Returns:
- precedence, must not be negative
-
toString
public java.lang.String toString()
- Overrides:
toStringin classPrologTerm
-
-