org.camunda.bpm.model.xml.impl.type.child
Class ChildElementCollectionImpl<T extends ModelElementInstance>

java.lang.Object
  extended by org.camunda.bpm.model.xml.impl.type.child.ChildElementCollectionImpl<T>
All Implemented Interfaces:
ChildElementCollection<T>
Direct Known Subclasses:
ChildElementImpl

public class ChildElementCollectionImpl<T extends ModelElementInstance>
extends Object
implements ChildElementCollection<T>

This collection is a view on an the children of a Model Element.

Author:
Daniel Meyer

Field Summary
protected  Class<T> childElementTypeClass
           
protected  int maxOccurs
          the maximum count of child elements in the collection.
 
Constructor Summary
ChildElementCollectionImpl(Class<T> childElementTypeClass, ModelElementTypeImpl parentElementType)
           
 
Method Summary
 Collection<T> get(ModelElementInstance element)
          returns a Collection containing all or a subset of the child elements of a ModelElementInstance.
 ModelElementType getChildElementType(Model model)
          Get the model element type of the elements contained in this collection.
 Class<T> getChildElementTypeClass()
          Get the class of the elements contained in this collection.
 int getMaxOccurs()
          Indicates the max element count of a collection.
 int getMinOccurs()
          Indicates the minimal element count of a collection.
 ModelElementType getParentElementType()
          Get the model element type of the element owns the collection
 boolean isImmutable()
          Indicates whether the collection is immutable.
 void setImmutable()
           
 void setMaxOccurs(int maxOccurs)
           
 void setMinOccurs(int minOccurs)
           
 void setMutable(boolean isMutable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

childElementTypeClass

protected final Class<T extends ModelElementInstance> childElementTypeClass

maxOccurs

protected int maxOccurs
the maximum count of child elements in the collection. An unbounded collection has a negative maxOccurs.

Constructor Detail

ChildElementCollectionImpl

public ChildElementCollectionImpl(Class<T> childElementTypeClass,
                                  ModelElementTypeImpl parentElementType)
Method Detail

setImmutable

public void setImmutable()

setMutable

public void setMutable(boolean isMutable)

isImmutable

public boolean isImmutable()
Description copied from interface: ChildElementCollection
Indicates whether the collection is immutable. If the collection is immutable, all state-altering operations such as Collection.add(Object) or Collection.remove(Object) will throw an UnsupportedOperationException.

Specified by:
isImmutable in interface ChildElementCollection<T extends ModelElementInstance>
Returns:
true if the collection is mutable, false otherwise.

getMinOccurs

public int getMinOccurs()
Description copied from interface: ChildElementCollection
Indicates the minimal element count of a collection. Returns a positive integer or '0'.

Specified by:
getMinOccurs in interface ChildElementCollection<T extends ModelElementInstance>
Returns:
the minimal element count of the collection.

setMinOccurs

public void setMinOccurs(int minOccurs)

getMaxOccurs

public int getMaxOccurs()
Description copied from interface: ChildElementCollection
Indicates the max element count of a collection. In a negative value is returned (like '-1'), the collection is unbounded.

Specified by:
getMaxOccurs in interface ChildElementCollection<T extends ModelElementInstance>
Returns:
the max element count for this collection.

getChildElementType

public ModelElementType getChildElementType(Model model)
Description copied from interface: ChildElementCollection
Get the model element type of the elements contained in this collection.

Specified by:
getChildElementType in interface ChildElementCollection<T extends ModelElementInstance>
Parameters:
model - the model of the element
Returns:
the containing ModelElementType

getChildElementTypeClass

public Class<T> getChildElementTypeClass()
Description copied from interface: ChildElementCollection
Get the class of the elements contained in this collection.

Specified by:
getChildElementTypeClass in interface ChildElementCollection<T extends ModelElementInstance>
Returns:
the class of contained types

getParentElementType

public ModelElementType getParentElementType()
Description copied from interface: ChildElementCollection
Get the model element type of the element owns the collection

Specified by:
getParentElementType in interface ChildElementCollection<T extends ModelElementInstance>
Returns:
the parent element of the collection

setMaxOccurs

public void setMaxOccurs(int maxOccurs)

get

public Collection<T> get(ModelElementInstance element)
Description copied from interface: ChildElementCollection
returns a Collection containing all or a subset of the child elements of a ModelElementInstance.

Specified by:
get in interface ChildElementCollection<T extends ModelElementInstance>


Copyright © 2015 camunda services GmbH. All rights reserved.