Package net.sf.tweety.lp.asp.syntax
Class ArithmeticTerm
- java.lang.Object
 - 
- net.sf.tweety.logics.commons.syntax.TermAdapter<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
 - 
- net.sf.tweety.lp.asp.syntax.ArithmeticTerm
 
 
 
- 
- All Implemented Interfaces:
 LogicStructure,Term<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
public class ArithmeticTerm extends TermAdapter<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
This class represents an arithmetic term in the ASP-Core-2 format. An arithmetic term is either -(t) or (t x u), where t and u are Terms and x is one of +,-,*,/- Author:
 - Anna Gessler
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description private ASPOperator.ArithmeticOperatoropThe arithmetic operator used in the arithmetic term.- 
Fields inherited from class net.sf.tweety.logics.commons.syntax.TermAdapter
value 
 - 
 
- 
Constructor Summary
Constructors Constructor Description ArithmeticTerm(Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>> triple)ArithmeticTerm(ArithmeticTerm other)ArithmeticTerm(ASPOperator.ArithmeticOperator op, Term<?> t)Creates an arithmetic term of the form -(t)ArithmeticTerm(ASPOperator.ArithmeticOperator op, Term<?> left, Term<?> right) 
- 
Method Summary
Modifier and Type Method Description TermAdapter<?>clone()Creates a deep copy of the termTerm<?>getLeft()Returns the left subterm of this arithmetic term.ASPOperator.ArithmeticOperatorgetOperator()Returns the operator of this arithmetic term.Term<?>getRight()Returns the right subterm of this arithmetic term.voidsetOperator(ASPOperator.ArithmeticOperator op)Sets the operator of this arithmetic term.java.lang.StringtoString()- 
Methods inherited from class net.sf.tweety.logics.commons.syntax.TermAdapter
containsTermsOfType, equals, get, getSort, getTerms, getTerms, hashCode, set, substitute 
 - 
 
 - 
 
- 
- 
Field Detail
- 
op
private ASPOperator.ArithmeticOperator op
The arithmetic operator used in the arithmetic term. 
 - 
 
- 
Constructor Detail
- 
ArithmeticTerm
public ArithmeticTerm(Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>> triple)
 
- 
ArithmeticTerm
public ArithmeticTerm(ArithmeticTerm other)
 
- 
ArithmeticTerm
public ArithmeticTerm(ASPOperator.ArithmeticOperator op, Term<?> left, Term<?> right)
 
- 
ArithmeticTerm
public ArithmeticTerm(ASPOperator.ArithmeticOperator op, Term<?> t)
Creates an arithmetic term of the form -(t)- Parameters:
 op- an operatort- a term
 
 - 
 
- 
Method Detail
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classTermAdapter<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
 
- 
clone
public TermAdapter<?> clone()
Description copied from interface:TermCreates a deep copy of the term- Specified by:
 clonein interfaceTerm<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>- Specified by:
 clonein classTermAdapter<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>- Returns:
 - the clone
 
 
- 
getOperator
public ASPOperator.ArithmeticOperator getOperator()
Returns the operator of this arithmetic term.- Returns:
 - an arithmetic operator
 
 
- 
setOperator
public void setOperator(ASPOperator.ArithmeticOperator op)
Sets the operator of this arithmetic term.- Parameters:
 op- an arithmetic operator
 
- 
getLeft
public Term<?> getLeft()
Returns the left subterm of this arithmetic term.- Returns:
 - left term
 
 
- 
getRight
public Term<?> getRight()
Returns the right subterm of this arithmetic term.- Returns:
 - right term
 
 
 - 
 
 -