partage
Class ComplexInstance.GenericObjectFormula

java.lang.Object
  extended by partage.ComplexInstance.GenericObjectFormula
All Implemented Interfaces:
ComplexInstance.LogicalObjectFormula
Direct Known Subclasses:
ComplexInstance.GenericObjectAgentFormula
Enclosing class:
ComplexInstance

public static class ComplexInstance.GenericObjectFormula
extends java.lang.Object
implements ComplexInstance.LogicalObjectFormula

A static class representing a generic propositional formula made of an array of subformulae, and a logical operator, on the set of objects.

Version:
july 2007
Author:
Sylvain Bouveret

Field Summary
static int OPERATOR_AND
           
static int OPERATOR_NOT
           
static int OPERATOR_OR
           
 
Constructor Summary
ComplexInstance.GenericObjectFormula(ComplexInstance.LogicalObjectFormula[] _sub, int _op)
           
 
Method Summary
static ComplexInstance.GenericObjectFormula and(ComplexInstance.LogicalObjectFormula[] _sub)
          Makes a conjunction of several formulae
static ComplexInstance.GenericObjectFormula and(ComplexInstance.LogicalObjectFormula _sub1, ComplexInstance.LogicalObjectFormula _sub2)
          Makes a conjunction of two formulae
 int[] getObjects()
          This methods returns the set of objects concerned by the formula.
 int getOperator()
          Standard getter to the operator
 ComplexInstance.LogicalObjectFormula[] getSubformulae()
          Standard getter to the subformulae
static ComplexInstance.GenericObjectFormula not(ComplexInstance.LogicalObjectFormula _sub)
          Makes a negation of a formula
static ComplexInstance.GenericObjectFormula or(ComplexInstance.LogicalObjectFormula[] _sub)
          Makes a disjunction of several formulae
static ComplexInstance.GenericObjectFormula or(ComplexInstance.LogicalObjectFormula _sub1, ComplexInstance.LogicalObjectFormula _sub2)
          Makes a disjunction of two formulae
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPERATOR_AND

public static final int OPERATOR_AND
See Also:
Constant Field Values

OPERATOR_OR

public static final int OPERATOR_OR
See Also:
Constant Field Values

OPERATOR_NOT

public static final int OPERATOR_NOT
See Also:
Constant Field Values
Constructor Detail

ComplexInstance.GenericObjectFormula

public ComplexInstance.GenericObjectFormula(ComplexInstance.LogicalObjectFormula[] _sub,
                                            int _op)
Method Detail

not

public static ComplexInstance.GenericObjectFormula not(ComplexInstance.LogicalObjectFormula _sub)
Makes a negation of a formula

Parameters:
_sub - the formula to negate.
Returns:
the negation.

or

public static ComplexInstance.GenericObjectFormula or(ComplexInstance.LogicalObjectFormula[] _sub)
Makes a disjunction of several formulae

Parameters:
_sub - the array of formulae
Returns:
the disjunction.

or

public static ComplexInstance.GenericObjectFormula or(ComplexInstance.LogicalObjectFormula _sub1,
                                                      ComplexInstance.LogicalObjectFormula _sub2)
Makes a disjunction of two formulae

Parameters:
_sub1 - the first formula
_sub2 - the second formula
Returns:
the disjunction.

and

public static ComplexInstance.GenericObjectFormula and(ComplexInstance.LogicalObjectFormula[] _sub)
Makes a conjunction of several formulae

Parameters:
_sub - the array of formulae
Returns:
the conjunction.

and

public static ComplexInstance.GenericObjectFormula and(ComplexInstance.LogicalObjectFormula _sub1,
                                                       ComplexInstance.LogicalObjectFormula _sub2)
Makes a conjunction of two formulae

Parameters:
_sub1 - the first formula
_sub2 - the second formula
Returns:
the conjunction.

getObjects

public int[] getObjects()
Description copied from interface: ComplexInstance.LogicalObjectFormula
This methods returns the set of objects concerned by the formula.

Specified by:
getObjects in interface ComplexInstance.LogicalObjectFormula
Returns:
the set of objects.

getOperator

public int getOperator()
Standard getter to the operator

Returns:
the "top" operator of the logical formula.

getSubformulae

public ComplexInstance.LogicalObjectFormula[] getSubformulae()
Standard getter to the subformulae

Returns:
the array of subformulae of the logical formula.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object