be.ac.vub.cocompose.lang.impl.constraints
Class DefaultCompositeConstraint

java.lang.Object
  extended bybe.ac.vub.cocompose.lang.impl.DefaultElement
      extended bybe.ac.vub.cocompose.lang.impl.core.DefaultModelElement
          extended bybe.ac.vub.cocompose.lang.impl.core.DefaultNamespace
              extended bybe.ac.vub.cocompose.lang.impl.constraints.DefaultConstraint
                  extended bybe.ac.vub.cocompose.lang.impl.constraints.DefaultCompositeConstraint
All Implemented Interfaces:
Cloneable, CompositeConstraint, Constraint, Element, ModelElement, Namespace, VisitedElement
Direct Known Subclasses:
DefaultAndConstraint, DefaultOrConstraint

public abstract class DefaultCompositeConstraint
extends DefaultConstraint
implements CompositeConstraint

Composite constraint.

Since:
0.2.0
Version:
0.2.0
Author:
Dennis Wagelaar

Constructor Summary
DefaultCompositeConstraint()
           
 
Method Summary
 void accept(ModelVisitor modelVisitor)
          Accepts a visitor.
 void acceptSuper(ModelVisitor modelVisitor)
          Invokes superclass accept().
 void addOwnedElement(int index, ModelElement modelElement)
          Adds an element to this namespace.
 List getOwnedConstraints()
          Returns the child constraints.
 void removeOwnedElement(ModelElement modelElement)
          Removes a element from this namespace.
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.constraints.DefaultConstraint
check, concreteCheck, getOwnerConstraint, isInverted, setInverted, setOwnerConstraint
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultNamespace
addOwnedElement, getDeepOwnedElements, getOwnedElement, getOwnedElementId, getOwnedElements, getOwnedElements, isRegistered, registerNameChange, translateIndex, translateIndex
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultModelElement
getId, getModel, getName, getNamespace, setId, setName, setNamespace, toString
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.DefaultElement
addPropertyChangeListener, firePropertyChange, fireStructureChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface be.ac.vub.cocompose.lang.constraints.Constraint
check, getOwnerConstraint, isInverted, setInverted, setOwnerConstraint
 
Methods inherited from interface be.ac.vub.cocompose.lang.core.Namespace
addOwnedElement, getDeepOwnedElements, getOwnedElement, getOwnedElementId, getOwnedElements, getOwnedElements, isRegistered, registerNameChange
 
Methods inherited from interface be.ac.vub.cocompose.lang.core.ModelElement
getId, getModel, getName, getNamespace, setId, setName, setNamespace
 
Methods inherited from interface be.ac.vub.cocompose.lang.Element
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

DefaultCompositeConstraint

public DefaultCompositeConstraint()
Method Detail

accept

public void accept(ModelVisitor modelVisitor)
            throws ModelElementException
Accepts a visitor.

Specified by:
accept in interface VisitedElement
Overrides:
accept in class DefaultConstraint
Parameters:
modelVisitor - The visitor to accept.
Throws:
ModelElementException

acceptSuper

public void acceptSuper(ModelVisitor modelVisitor)
                 throws ModelElementException
Invokes superclass accept().

Overrides:
acceptSuper in class DefaultConstraint
Parameters:
modelVisitor - The visitor to accept.
Throws:
ModelElementException
See Also:
accept(ModelVisitor)

getOwnedConstraints

public List getOwnedConstraints()
Returns the child constraints.

Specified by:
getOwnedConstraints in interface CompositeConstraint
Returns:
a copy of the List of child constraints.

addOwnedElement

public void addOwnedElement(int index,
                            ModelElement modelElement)
                     throws ModelElementException
Adds an element to this namespace.

Specified by:
addOwnedElement in interface Namespace
Overrides:
addOwnedElement in class DefaultNamespace
Parameters:
index - - the index at which to add the element.
modelElement - - the element to add.
Throws:
ModelElementException - - if the name of the element is already used within this namespace.

removeOwnedElement

public void removeOwnedElement(ModelElement modelElement)
Removes a element from this namespace.

Specified by:
removeOwnedElement in interface Namespace
Overrides:
removeOwnedElement in class DefaultNamespace
Parameters:
modelElement - - the element to remove.