org.deri.wsmo4j.logicalexpression.terms
Class ConstructedTermImpl

java.lang.Object
  extended by org.deri.wsmo4j.logicalexpression.terms.ConstructedTermImpl
All Implemented Interfaces:
org.omwg.logicalexpression.terms.ConstructedTerm, org.omwg.logicalexpression.terms.Term
Direct Known Subclasses:
BuiltInConstructedTermImpl

public class ConstructedTermImpl
extends Object
implements org.omwg.logicalexpression.terms.ConstructedTerm

Version:
$Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
Author:
DERI Innsbruck, reto.krummenacher@deri.org, holger.lausen@deri.org
See Also:
ConstructedTerm

Constructor Summary
ConstructedTermImpl(org.wsmo.common.IRI functionSymbol, List<org.omwg.logicalexpression.terms.Term> terms)
           
 
Method Summary
 void accept(org.omwg.logicalexpression.terms.Visitor v)
           
 boolean equals(Object o)
           The equals method implements an equivalence relation on non-null object references.
 int getArity()
           
 org.wsmo.common.IRI getFunctionSymbol()
           
 org.omwg.logicalexpression.terms.Term getParameter(int i)
           
 int hashCode()
           If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
 List listParameters()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstructedTermImpl

public ConstructedTermImpl(org.wsmo.common.IRI functionSymbol,
                           List<org.omwg.logicalexpression.terms.Term> terms)
                    throws IllegalArgumentException
Parameters:
functionSymbol - the name of the term, in form of an IRI
terms - List of Terms
Throws:
IllegalArgumentException - in case the functionSymbol is null or the arguments of the list aren't all of Type Term
See Also:
LogicalExpressionFactory.createConstructedTerm(IRI, List)
Method Detail

getFunctionSymbol

public org.wsmo.common.IRI getFunctionSymbol()
Specified by:
getFunctionSymbol in interface org.omwg.logicalexpression.terms.ConstructedTerm
Returns:
the name of the term, in wsml only possible in form of an IRI
See Also:
ConstructedTerm.getFunctionSymbol()

getArity

public int getArity()
Specified by:
getArity in interface org.omwg.logicalexpression.terms.ConstructedTerm
Returns:
the arity of the term, i.e. the number of parameters
See Also:
ConstructedTerm.getArity()

getParameter

public org.omwg.logicalexpression.terms.Term getParameter(int i)
                                                   throws IndexOutOfBoundsException
Specified by:
getParameter in interface org.omwg.logicalexpression.terms.ConstructedTerm
Parameters:
i - the position of the parameter desired, maximal getArity()-1
Returns:
a Term, the chosen parameter
Throws:
IndexOutOfBoundsException - if the index is out of range (arity)
See Also:
ConstructedTerm.getParameter(int)

accept

public void accept(org.omwg.logicalexpression.terms.Visitor v)
Specified by:
accept in interface org.omwg.logicalexpression.terms.Term
See Also:
Term.accept(org.omwg.logicalexpression.terms.Visitor)

toString

public String toString()
Overrides:
toString in class Object
Returns:
The String representation of the constructed term
See Also:
Object.toString()

equals

public boolean equals(Object o)

The equals method implements an equivalence relation on non-null object references. Two constructed terms are equal if their arity, their functionSymbol, and all of the arguments from the list of terms are equal.

It is generally necessary to override the hashCode method whenever this method is overridden.

Overrides:
equals in class Object
Parameters:
o - Object of Type ConstructedTerm
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.equals(java.lang.Object), Object.hashCode()

hashCode

public int hashCode()

If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. However, it is not required that if two objects are unequal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results.

This method should be overriden, when the equals(Object) method is overriden.

Overrides:
hashCode in class Object
Returns:
A hash code value for this Object.
See Also:
Object.hashCode(), Object.equals(Object), IRIImpl.hashCode()

listParameters

public List listParameters()
Specified by:
listParameters in interface org.omwg.logicalexpression.terms.ConstructedTerm
See Also:
ConstructedTerm.listParameters()


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.