tom.engine.adt.tomconstraint.types.constraint
Class OrConstraint

java.lang.Object
  extended by tom.engine.adt.tomconstraint.TomConstraintAbstractType
      extended by tom.engine.adt.tomconstraint.types.Constraint
          extended by tom.engine.adt.tomconstraint.types.constraint.OrConstraint
All Implemented Interfaces:
Comparable, Iterable<Constraint>, Collection<Constraint>, shared.SharedObject, shared.SharedObjectWithID, Visitable
Direct Known Subclasses:
ConsOrConstraint, EmptyOrConstraint

public abstract class OrConstraint
extends Constraint
implements Collection<Constraint>


Field Summary
 
Fields inherited from class tom.engine.adt.tomconstraint.types.Constraint
idConv
 
Fields inherited from class tom.engine.adt.tomconstraint.TomConstraintAbstractType
atermFactory, factory
 
Constructor Summary
OrConstraint()
           
 
Method Summary
 boolean add(Constraint o)
           
 boolean addAll(Collection<? extends Constraint> c)
           
 Constraint append(Constraint element)
          Appends an element
 void clear()
           
 boolean contains(Object o)
          Checks if tom.engine.adt.tomconstraint.types.Constraint contains a specified object
 boolean containsAll(Collection c)
           
static Constraint fromArray(Constraint[] array)
           
static Constraint fromTerm(aterm.ATerm trm, ATermConverter atConv)
          Apply a conversion on the ATerm contained in the String and returns a tom.engine.adt.tomconstraint.types.Constraint from it
 Collection<Constraint> getCollection()
           
 Collection<Constraint> getCollectionOrConstraint()
          Returns a Collection extracted from the term
 boolean isEmpty()
          Checks the emptiness
 Iterator<Constraint> iterator()
           
 int length()
          Returns the number of arguments of the variadic operator
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 Constraint reverse()
          Inverses the term if it is a list
 int size()
          Returns the size of the collection
 Object[] toArray()
          Returns an array containing the elements of the collection
<T> T[]
toArray(T[] array)
           
 aterm.ATerm toATerm()
          Returns an ATerm representation of this term.
 void toStringBuilder(StringBuilder buffer)
          Appends a string representation of this term to the buffer given as argument.
 
Methods inherited from class tom.engine.adt.tomconstraint.types.Constraint
fromStream, fromStream, fromString, fromString, fromTerm, getAstType, getBQTerm, getc, getCollectionAndConstraint, getCollectionOrConstraintDisjunction, getConstraint, getHeadAndConstraint, getHeadOrConstraint, getHeadOrConstraintDisjunction, getIndex, getLeft, getOpname, getPattern, getRight, getSubject, getTailAndConstraint, getTailOrConstraint, getTailOrConstraintDisjunction, getType, getVar, getVariable, isAliasTo, isAntiMatchConstraint, isAssignPositionTo, isConsAndConstraint, isConsOrConstraint, isConsOrConstraintDisjunction, isEmptyAndConstraint, isEmptyArrayConstraint, isEmptyListConstraint, isEmptyOrConstraint, isEmptyOrConstraintDisjunction, isFalseConstraint, isIsSortConstraint, isMatchConstraint, isNegate, isNumericConstraint, isTrueConstraint, setAstType, setBQTerm, setc, setConstraint, setHeadAndConstraint, setHeadOrConstraint, setHeadOrConstraintDisjunction, setIndex, setLeft, setOpname, setPattern, setRight, setSubject, setTailAndConstraint, setTailOrConstraint, setTailOrConstraintDisjunction, setType, setVar, setVariable
 
Methods inherited from class tom.engine.adt.tomconstraint.TomConstraintAbstractType
compareTo, compareToLPO, convertATermToBoolean, convertATermToChar, convertATermToDouble, convertATermToFloat, convertATermToInt, convertATermToLong, convertATermToString, getUniqueIdentifier, setUniqueIdentifier, symbolName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 
Methods inherited from interface shared.SharedObject
duplicate, equivalent, hashCode
 
Methods inherited from interface tom.library.sl.Visitable
getChildAt, getChildCount, getChildren, setChildAt, setChildren
 

Constructor Detail

OrConstraint

public OrConstraint()
Method Detail

length

public int length()
Returns the number of arguments of the variadic operator

Overrides:
length in class Constraint
Returns:
the number of arguments of the variadic operator

fromArray

public static Constraint fromArray(Constraint[] array)

reverse

public Constraint reverse()
Inverses the term if it is a list

Overrides:
reverse in class Constraint
Returns:
the inverted term if it is a list, otherwise the term itself

append

public Constraint append(Constraint element)
Appends an element

Parameters:
element - element which has to be added
Returns:
the term with the added element

toStringBuilder

public void toStringBuilder(StringBuilder buffer)
Appends a string representation of this term to the buffer given as argument.

Specified by:
toStringBuilder in class TomConstraintAbstractType
Parameters:
buffer - the buffer to which a string represention of this term is appended.

toATerm

public aterm.ATerm toATerm()
Returns an ATerm representation of this term.

Overrides:
toATerm in class Constraint
Returns:
an ATerm representation of this term.

fromTerm

public static Constraint fromTerm(aterm.ATerm trm,
                                  ATermConverter atConv)
Apply a conversion on the ATerm contained in the String and returns a tom.engine.adt.tomconstraint.types.Constraint from it

Parameters:
trm - ATerm to convert into a Gom term
atConv - ATerm Converter used to convert the ATerm
Returns:
the Gom term

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection<Constraint>

contains

public boolean contains(Object o)
Checks if tom.engine.adt.tomconstraint.types.Constraint contains a specified object

Specified by:
contains in interface Collection<Constraint>
Parameters:
o - object whose presence is tested
Returns:
true if tom.engine.adt.tomconstraint.types.Constraint contains the object, otherwise false

isEmpty

public boolean isEmpty()
Checks the emptiness

Specified by:
isEmpty in interface Collection<Constraint>
Returns:
true if empty, otherwise false

iterator

public Iterator<Constraint> iterator()
Specified by:
iterator in interface Iterable<Constraint>
Specified by:
iterator in interface Collection<Constraint>

add

public boolean add(Constraint o)
Specified by:
add in interface Collection<Constraint>

addAll

public boolean addAll(Collection<? extends Constraint> c)
Specified by:
addAll in interface Collection<Constraint>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Constraint>

clear

public void clear()
Specified by:
clear in interface Collection<Constraint>

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection<Constraint>

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection<Constraint>

size

public int size()
Returns the size of the collection

Specified by:
size in interface Collection<Constraint>
Returns:
the size of the collection

toArray

public Object[] toArray()
Returns an array containing the elements of the collection

Specified by:
toArray in interface Collection<Constraint>
Returns:
an array of elements

toArray

public <T> T[] toArray(T[] array)
Specified by:
toArray in interface Collection<Constraint>

getCollection

public Collection<Constraint> getCollection()

getCollectionOrConstraint

public Collection<Constraint> getCollectionOrConstraint()
Description copied from class: Constraint
Returns a Collection extracted from the term

Overrides:
getCollectionOrConstraint in class Constraint
Returns:
the collection