protected static class ItemProviderAdapter.ChildrenStore
extends java.lang.Object
ChildrenStore
stores a number of objects that are to be presented as the children of an object.
Each of a set of feature
s may have either one or any number
of children objects associated with it, depending on its multiplicity. The objects associated with a
multiplicity-many feature are accessed and manipulated as an EList
,
typically mirroring the actual values of that feature, with some or all in wrappers, as necessary. The object
associated with a multiplicity-1 feature is typically accessed and set directly, although a modifiable, singleton
list view is available. This class provides a number of convenient methods for access by feature, as well as
a method, getChildren
that returns the complete collection of children from all features as
an unmodifiable list.Modifier and Type | Class and Description |
---|---|
protected static class |
ItemProviderAdapter.ChildrenStore.Entry
An
Entry represents the children from a feature. |
Modifier and Type | Field and Description |
---|---|
protected ItemProviderAdapter.ChildrenStore.Entry[] |
entries |
Constructor and Description |
---|
ItemProviderAdapter.ChildrenStore(java.util.Collection<? extends EStructuralFeature> features)
Creates a store for the children of the given features.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the children of all features in the store.
|
boolean |
contains(EStructuralFeature feature)
Returns whether the store handles children of the specified feature.
|
protected EList<java.lang.Object> |
createList(EStructuralFeature feature)
Returns a list, either a full list implementation or a fixed-sized modifiable singleton list, depending
on the multiplicity of the feature.
|
java.lang.Object |
get(EStructuralFeature feature,
int index)
Returns either a single element of the specified feature or, if index is -1, the value view.
|
java.util.List<java.lang.Object> |
getChildren()
Returns a list containing all children of all features in the store.
|
protected ItemProviderAdapter.ChildrenStore.Entry |
getEntry(EStructuralFeature feature) |
EList<java.lang.Object> |
getList(EStructuralFeature feature)
Returns the list view of the specified feature, or null if the store does not handle the feature.
|
int |
getOffset(EStructuralFeature feature)
Returns the offset in the list returned by
getChildren of given feature's children. |
java.lang.Object |
getValue(EStructuralFeature feature)
Returns the value view of the specified feature.
|
boolean |
set(EStructuralFeature feature,
int index,
java.lang.Object object)
Sets either a single element of the specified feature or, if the index is -1, the value of the feature.
|
boolean |
setValue(EStructuralFeature feature,
java.lang.Object value)
Sets the value of the specified feature.
|
protected ItemProviderAdapter.ChildrenStore.Entry[] entries
public ItemProviderAdapter.ChildrenStore(java.util.Collection<? extends EStructuralFeature> features)
protected ItemProviderAdapter.ChildrenStore.Entry getEntry(EStructuralFeature feature)
protected EList<java.lang.Object> createList(EStructuralFeature feature)
public boolean contains(EStructuralFeature feature)
public EList<java.lang.Object> getList(EStructuralFeature feature)
public java.lang.Object getValue(EStructuralFeature feature)
public boolean setValue(EStructuralFeature feature, java.lang.Object value)
Collection
, and all of its elements are added to the emptied list.public java.lang.Object get(EStructuralFeature feature, int index)
public boolean set(EStructuralFeature feature, int index, java.lang.Object object)
public java.util.List<java.lang.Object> getChildren()
public int getOffset(EStructuralFeature feature)
getChildren
of given feature's children.public void clear()