org.qedeq.kernel.bo.parser
Class Term

java.lang.Object
  extended by org.qedeq.kernel.bo.parser.Term

public class Term
extends java.lang.Object

Parsed term.

Version:
$Revision: 1.1 $
Author:
Michael Meyling

Constructor Summary
Term(Operator operator)
          Constructor.
Term(Operator operator, Term firstArgument)
          Constructor.
Term(TermAtom atom)
          Constructor.
 
Method Summary
 void addArgument(Term term)
          Add next argument term to operator.
 Operator getOperator()
          Get operator of term.
 java.lang.String getQedeq()
          Get QEDEQ representation of this term.
 java.lang.String getQedeqXml()
          Get QEDEQ XML representation of this term.
 boolean isAtom()
          Is this term an atom?
 int size()
          Get number of arguments of this operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Term

public Term(TermAtom atom)
Constructor.

Parameters:
atom - Term atom.

Term

public Term(Operator operator)
Constructor.

Parameters:
operator - Construct new term for this operator.

Term

public Term(Operator operator,
            Term firstArgument)
Constructor.

Parameters:
operator - Construct new term for this operator.
firstArgument - First argument of operator.
Method Detail

isAtom

public final boolean isAtom()
Is this term an atom?

Returns:
Is this term an atom?

addArgument

public final void addArgument(Term term)
Add next argument term to operator. Overall number of arguments must not exceed Operator.getMax() (if >= 0). Addition is only possible if this is no atom term (see Term(TermAtom)).

Parameters:
term - Add this argument at last position.
Throws:
java.lang.IllegalArgumentException - This is an atom term or argument maximum exceeded.

getOperator

public final Operator getOperator()
Get operator of term. Can be null if this is an atom term.

Returns:
Term operator.

size

public final int size()
Get number of arguments of this operator.

Returns:
Argument number.

getQedeq

public final java.lang.String getQedeq()
Get QEDEQ representation of this term.

Returns:
QEDEQ representation.

getQedeqXml

public final java.lang.String getQedeqXml()
Get QEDEQ XML representation of this term.

Returns:
QEDEQ XML representation.


Copyright © 2014. All Rights Reserved.