public class ChildElementCollectionImpl<T extends ModelElementInstance> extends Object implements ChildElementCollection<T>
This collection is a view on an the children of a Model Element.
Modifier and Type | Field and Description |
---|---|
protected Class<T> |
childElementTypeClass |
protected int |
maxOccurs
the maximum count of child elements in the collection.
|
Constructor and Description |
---|
ChildElementCollectionImpl(Class<T> childElementTypeClass,
ModelElementTypeImpl parentElementType) |
Modifier and Type | Method and Description |
---|---|
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) |
protected final Class<T extends ModelElementInstance> childElementTypeClass
protected int maxOccurs
public ChildElementCollectionImpl(Class<T> childElementTypeClass, ModelElementTypeImpl parentElementType)
public void setImmutable()
public void setMutable(boolean isMutable)
public boolean isImmutable()
ChildElementCollection
Collection.add(Object)
or Collection.remove(Object)
will throw an UnsupportedOperationException
.isImmutable
in interface ChildElementCollection<T extends ModelElementInstance>
public int getMinOccurs()
ChildElementCollection
getMinOccurs
in interface ChildElementCollection<T extends ModelElementInstance>
public void setMinOccurs(int minOccurs)
public int getMaxOccurs()
ChildElementCollection
getMaxOccurs
in interface ChildElementCollection<T extends ModelElementInstance>
public ModelElementType getChildElementType(Model model)
ChildElementCollection
getChildElementType
in interface ChildElementCollection<T extends ModelElementInstance>
model
- the model of the elementModelElementType
public Class<T> getChildElementTypeClass()
ChildElementCollection
getChildElementTypeClass
in interface ChildElementCollection<T extends ModelElementInstance>
public ModelElementType getParentElementType()
ChildElementCollection
getParentElementType
in interface ChildElementCollection<T extends ModelElementInstance>
public void setMaxOccurs(int maxOccurs)
public Collection<T> get(ModelElementInstance element)
ChildElementCollection
Collection
containing all or a subset of the child elements of
a ModelElementInstance
.get
in interface ChildElementCollection<T extends ModelElementInstance>
Copyright © 2017. All rights reserved.