Pandora
Class PanSignature

java.lang.Object
  extended by Pandora.PanSignature
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PanSignature
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

The Pandora Signature.

See Also:
Serialized Form

Constructor Summary
PanSignature()
          Constructs an empty PanSignature.
PanSignature(java.util.List<Atom> predicates, java.util.List<SimpleTerm> constants, java.util.List<Function> functions, java.util.List<Var> variables, java.util.List<SimpleTerm> skolems)
          Constructs a PanSignature with the passed list of parameters
 
Method Summary
 void addConstant(java.lang.String name)
          This method is called when a user wants to add a new Constant to the signature via the "Add to signtaure" option on the menu.
 void addConstsToSignature(java.util.List<SimpleTerm> terms)
          Adds all the SimpleTerms in the passed SimpleTerm List to this PanSignature's Constant list IF the signature does not already contain them.
 void addFuncsToSignature(java.util.List<Function> funcs)
          Adds all the Functions in the passed Function List to this PanSignature's Function list IF the signature does not already contain them.
 void addFunction(java.lang.String name, int arity)
          This method is called when a user wants to add a new function to the signature via the "Add to signtaure" option on the menu.
 void addPredicate(java.lang.String name, int arity)
          This method is called when a user wants to add a new Predicate to the signature via the "Add to signtaure" option on the menu.
 void addTermsToSignature(java.util.List<Term> terms)
          Adds all the Terms in the passed Term List to this PanSignature IF the signature does not already contain them.
 void addToSignature(java.util.List<Atom> predicates)
          Adds all the Atoms in the passed Atom List to this PanSignature's Predicate list IF the signature does not already contain them.
 void addToSignature(PanSignature sig)
           
 void addVarsToSignature(java.util.List<Var> vars)
          Adds all the Vars in the passed Var List to this PanSignature's Var list IF the signature does not already contain them.
 void addVarToSignature(Var var)
          Adds the passed Var to this PanSignature's Variable list IF the signature does not already contain them.
 PanSignature clone()
          Returns a copy(clone) of this PanSignature.
 PanSignature compare(PanSignature sign)
          Returns a PanSignature containing the difference of this signature and the passed signature
I.e The returned signature will contain all Predicates/Functions/SimpleTerms/Variables that the passed signaure contains and this signature doesn't.
 void display()
           
 java.util.List<SimpleTerm> getConstants()
          Returns the Constant list of the PanSignature.
 java.util.List<Function> getFunctions()
          Returns the Function list of the PanSignature.
 java.util.List<Atom> getPredicates()
          Returns the Predicate list of the PanSignature.
 java.util.List<SimpleTerm> getSkolems()
          Returns the Skolem Constant list of the PanSignature.
 java.util.List<SVar> getSVars()
          Returns the SVariable list of the PanSignature.
 java.util.List<Var> getVariables()
          Returns the Variable list of the PanSignature.
 boolean isEmpty()
          Returns true if the PanSignature is empty.
A PanSignature is empty if its Predicate,Constant and the Function lists are empty.
 void setSignature(PanSignature newS)
          Sets this PanSignature to the passed PanSignature by copying its lists' contents.
 java.lang.String show()
          Returns a String representation of the PanSignature.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PanSignature

public PanSignature(java.util.List<Atom> predicates,
                    java.util.List<SimpleTerm> constants,
                    java.util.List<Function> functions,
                    java.util.List<Var> variables,
                    java.util.List<SimpleTerm> skolems)
Constructs a PanSignature with the passed list of parameters

Parameters:
predicates - List represents the predicate list of the signature.
constants - List represents the constant list of the signature.
functions - List represents the function list of the signature.
variables - List represents the variable list of the signature.
skolems - List represents the skolem constant list of the signature.
svars - List represents the SVariable list of the signature.

PanSignature

public PanSignature()
Constructs an empty PanSignature.

Method Detail

getPredicates

public java.util.List<Atom> getPredicates()
Returns the Predicate list of the PanSignature.


getConstants

public java.util.List<SimpleTerm> getConstants()
Returns the Constant list of the PanSignature.


getFunctions

public java.util.List<Function> getFunctions()
Returns the Function list of the PanSignature.


getVariables

public java.util.List<Var> getVariables()
Returns the Variable list of the PanSignature.


getSkolems

public java.util.List<SimpleTerm> getSkolems()
Returns the Skolem Constant list of the PanSignature.


getSVars

public java.util.List<SVar> getSVars()
Returns the SVariable list of the PanSignature.


setSignature

public void setSignature(PanSignature newS)
Sets this PanSignature to the passed PanSignature by copying its lists' contents.

Parameters:
newS - PanSignature represents the PanSignature which is to replace this PanSignature.

addToSignature

public void addToSignature(PanSignature sig)

addToSignature

public void addToSignature(java.util.List<Atom> predicates)
Adds all the Atoms in the passed Atom List to this PanSignature's Predicate list IF the signature does not already contain them.


addConstsToSignature

public void addConstsToSignature(java.util.List<SimpleTerm> terms)
Adds all the SimpleTerms in the passed SimpleTerm List to this PanSignature's Constant list IF the signature does not already contain them.


addVarToSignature

public void addVarToSignature(Var var)
Adds the passed Var to this PanSignature's Variable list IF the signature does not already contain them.


addVarsToSignature

public void addVarsToSignature(java.util.List<Var> vars)
Adds all the Vars in the passed Var List to this PanSignature's Var list IF the signature does not already contain them.


addFuncsToSignature

public void addFuncsToSignature(java.util.List<Function> funcs)
Adds all the Functions in the passed Function List to this PanSignature's Function list IF the signature does not already contain them.


addTermsToSignature

public void addTermsToSignature(java.util.List<Term> terms)
Adds all the Terms in the passed Term List to this PanSignature IF the signature does not already contain them.


clone

public PanSignature clone()
Returns a copy(clone) of this PanSignature.

Overrides:
clone in class java.lang.Object

show

public java.lang.String show()
Returns a String representation of the PanSignature.


display

public void display()

compare

public PanSignature compare(PanSignature sign)
Returns a PanSignature containing the difference of this signature and the passed signature
I.e The returned signature will contain all Predicates/Functions/SimpleTerms/Variables that the passed signaure contains and this signature doesn't.

Parameters:
sign - PanSignature the signature to be compared against this PanSignature.

isEmpty

public boolean isEmpty()
Returns true if the PanSignature is empty.
A PanSignature is empty if its Predicate,Constant and the Function lists are empty.


addFunction

public void addFunction(java.lang.String name,
                        int arity)
                 throws java.lang.Exception
This method is called when a user wants to add a new function to the signature via the "Add to signtaure" option on the menu.

Parameters:
name - String represents the name of the newly introduced Function.
arity - int represents the arity of the newly introduced Function.
Throws:
java.lang.Exception

addPredicate

public void addPredicate(java.lang.String name,
                         int arity)
                  throws java.lang.Exception
This method is called when a user wants to add a new Predicate to the signature via the "Add to signtaure" option on the menu.

Parameters:
name - String represents the name of the newly introduced Predicate.
arity - int represents the arity of the newly introduced Predicate.
Throws:
java.lang.Exception

addConstant

public void addConstant(java.lang.String name)
                 throws java.lang.Exception
This method is called when a user wants to add a new Constant to the signature via the "Add to signtaure" option on the menu.

Parameters:
name - String represents the name of the newly introduced Constant.
Throws:
java.lang.Exception