T - The type of the formulas which are saved by the
associative formula support.public class AssociativeFormulaSupport<T extends SimpleLogicalFormula> extends ComplexLogicalFormulaAdapter implements AssociativeFormula<T>
| Modifier and Type | Class and Description |
|---|---|
static interface |
AssociativeFormulaSupport.AssociativeSupportBridge
This interface defines a bridge between the AssociativeFormula
implementation like a concrete Disjunction and the AssociativeFormulaSupport
object which adds the implementation of the common functionality.
|
| Modifier and Type | Field and Description |
|---|---|
private AssociativeFormulaSupport.AssociativeSupportBridge |
bridge
the bridge to the real implementation
|
private java.util.List<T> |
formulas
the set of formulas
|
| Constructor and Description |
|---|
AssociativeFormulaSupport(AssociativeFormulaSupport.AssociativeSupportBridge bridge)
Ctor: Creates a AssociativeFormulaSupport object that uses the
given bridge
|
AssociativeFormulaSupport(AssociativeFormulaSupport<T> other)
Copy-Ctor creates a deep copy of the associative formula support.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
add(T e) |
boolean |
addAll(java.util.Collection<? extends T> c) |
boolean |
addAll(int index,
java.util.Collection<? extends T> c) |
private ComplexLogicalFormula |
checkedFormulaType(T formula) |
void |
clear() |
AssociativeFormulaSupport<T> |
clone()
Creates a deep copy of this formula
|
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
java.util.Collection<T> |
copyHelper(java.util.Collection<T> collection)
This method generates a deep copy of the given collection of RelationalFormula
|
boolean |
equals(java.lang.Object other) |
T |
get(int index) |
java.util.Set<? extends Atom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
java.util.List<T> |
getFormulas() |
<C extends SimpleLogicalFormula> |
getFormulas(java.lang.Class<C> cls)
Process the formulas of type C that are children of this associative
formula
|
java.lang.Class<? extends Predicate> |
getPredicateCls() |
java.util.Set<? extends Predicate> |
getPredicates()
Processes the set of all predicates which appear in this
formula
|
Signature |
getSignature()
Returns the signature of the language of this formula.
|
java.util.Set<Term<?>> |
getTerms() |
<C extends Term<?>> |
getTerms(java.lang.Class<C> cls)
Processes the set containing all terms of type C.
|
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
boolean |
isWellFormed()
Checks if this formula is well formed in the logical langauge.
|
java.util.Iterator<T> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<T> |
listIterator() |
java.util.ListIterator<T> |
listIterator(int index) |
T |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
T |
set(int index,
T element) |
int |
size() |
java.util.List<T> |
subList(int fromIndex,
int toIndex) |
ComplexLogicalFormula |
substitute(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
java.lang.Object[] |
toArray() |
<C> C[] |
toArray(C[] a) |
java.lang.String |
toString() |
containsTermsOfType, exchange, isGround, isLiteral, substitutefinalize, getClass, notify, notifyAll, wait, wait, waitisLiteralprivate AssociativeFormulaSupport.AssociativeSupportBridge bridge
private java.util.List<T extends SimpleLogicalFormula> formulas
public AssociativeFormulaSupport(AssociativeFormulaSupport.AssociativeSupportBridge bridge)
bridge - public AssociativeFormulaSupport(AssociativeFormulaSupport<T> other)
other - public java.util.Collection<T> copyHelper(java.util.Collection<T> collection)
collection - The collection of RelationalFormula to copypublic java.util.List<T> getFormulas()
getFormulas in interface AssociativeFormula<T extends SimpleLogicalFormula>public <C extends SimpleLogicalFormula> java.util.Set<C> getFormulas(java.lang.Class<C> cls)
AssociativeFormulagetFormulas in interface AssociativeFormula<T extends SimpleLogicalFormula>cls - the class structure defining the type of formulas which
are searched.public java.util.Set<? extends Atom> getAtoms()
SimpleLogicalFormulagetAtoms in interface SimpleLogicalFormulapublic java.util.Set<? extends Predicate> getPredicates()
SimpleLogicalFormulagetPredicates in interface SimpleLogicalFormulapublic Signature getSignature()
FormulagetSignature in interface Formulapublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in interface java.util.Collection<T extends SimpleLogicalFormula>equals in interface java.util.List<T extends SimpleLogicalFormula>equals in interface SimpleLogicalFormulaequals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<T extends SimpleLogicalFormula>hashCode in interface java.util.List<T extends SimpleLogicalFormula>hashCode in interface SimpleLogicalFormulahashCode in class java.lang.Objectpublic AssociativeFormulaSupport<T> clone()
SimpleLogicalFormulaclone in interface ComplexLogicalFormulaclone in interface SimpleLogicalFormulaclone in class ComplexLogicalFormulaAdapterprivate ComplexLogicalFormula checkedFormulaType(T formula)
public java.util.Set<Term<?>> getTerms()
getTerms in interface LogicStructurepublic <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls)
LogicStructuregetTerms in interface LogicStructuregetTerms in class ComplexLogicalFormulaAdaptercls - The Class structure containing type information about the
searched termpublic ComplexLogicalFormula substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
ComplexLogicalFormulasubstitute in interface ComplexLogicalFormulav - the term to be substituted.t - the term to substitute.java.lang.IllegalArgumentException - if "v" and "t" are of different sortspublic boolean isWellFormed()
ComplexLogicalFormulaisWellFormed in interface ComplexLogicalFormulaisWellFormed in class ComplexLogicalFormulaAdapterpublic boolean add(T e)
add in interface java.util.Collection<T extends SimpleLogicalFormula>add in interface java.util.List<T extends SimpleLogicalFormula>public boolean addAll(java.util.Collection<? extends T> c)
addAll in interface java.util.Collection<T extends SimpleLogicalFormula>addAll in interface java.util.List<T extends SimpleLogicalFormula>public void clear()
clear in interface java.util.Collection<T extends SimpleLogicalFormula>clear in interface java.util.List<T extends SimpleLogicalFormula>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<T extends SimpleLogicalFormula>contains in interface java.util.List<T extends SimpleLogicalFormula>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<T extends SimpleLogicalFormula>containsAll in interface java.util.List<T extends SimpleLogicalFormula>public boolean isEmpty()
isEmpty in interface java.util.Collection<T extends SimpleLogicalFormula>isEmpty in interface java.util.List<T extends SimpleLogicalFormula>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends SimpleLogicalFormula>iterator in interface java.util.Collection<T extends SimpleLogicalFormula>iterator in interface java.util.List<T extends SimpleLogicalFormula>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<T extends SimpleLogicalFormula>remove in interface java.util.List<T extends SimpleLogicalFormula>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<T extends SimpleLogicalFormula>removeAll in interface java.util.List<T extends SimpleLogicalFormula>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<T extends SimpleLogicalFormula>retainAll in interface java.util.List<T extends SimpleLogicalFormula>public int size()
size in interface java.util.Collection<T extends SimpleLogicalFormula>size in interface java.util.List<T extends SimpleLogicalFormula>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<T extends SimpleLogicalFormula>toArray in interface java.util.List<T extends SimpleLogicalFormula>public <C> C[] toArray(C[] a)
toArray in interface java.util.Collection<T extends SimpleLogicalFormula>toArray in interface java.util.List<T extends SimpleLogicalFormula>public java.lang.Class<? extends Predicate> getPredicateCls()
getPredicateCls in interface SimpleLogicalFormulapublic void add(int index,
T element)
add in interface java.util.List<T extends SimpleLogicalFormula>public boolean addAll(int index,
java.util.Collection<? extends T> c)
addAll in interface java.util.List<T extends SimpleLogicalFormula>public T get(int index)
get in interface java.util.List<T extends SimpleLogicalFormula>public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<T extends SimpleLogicalFormula>public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<T extends SimpleLogicalFormula>public java.util.ListIterator<T> listIterator()
listIterator in interface java.util.List<T extends SimpleLogicalFormula>public java.util.ListIterator<T> listIterator(int index)
listIterator in interface java.util.List<T extends SimpleLogicalFormula>public T remove(int index)
remove in interface java.util.List<T extends SimpleLogicalFormula>public T set(int index, T element)
set in interface java.util.List<T extends SimpleLogicalFormula>public java.util.List<T> subList(int fromIndex, int toIndex)
subList in interface java.util.List<T extends SimpleLogicalFormula>