Package com._1c.g5.v8.dt.core.provider
Class BmListMergeSupport
- java.lang.Object
-
- com._1c.g5.v8.dt.core.provider.BmListMergeSupport
-
public class BmListMergeSupport extends Object
Special list analyzer for updating EList in model by new values
-
-
Constructor Summary
Constructors Constructor Description BmListMergeSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
equal(Object oldValue, Object newValue)
Used bymerge(EList, EList)
to decide whether the old value is considered equal to the new value.<T> void
merge(org.eclipse.emf.common.util.EList<T> externalValue, org.eclipse.emf.common.util.EList<T> internalValue)
Same as {@link merge(EList, EList, true)}<T> void
merge(org.eclipse.emf.common.util.EList<T> externalValue, org.eclipse.emf.common.util.EList<T> internalValue, boolean containment)
MergesinternalValue
byexternalValue
.
-
-
-
Method Detail
-
merge
public <T> void merge(org.eclipse.emf.common.util.EList<T> externalValue, org.eclipse.emf.common.util.EList<T> internalValue)
Same as {@link merge(EList, EList, true)}- Parameters:
externalValue
- contains external values, not modified, can't benull
internalValue
- updating values, will be modified in method, can't benull
- See Also:
merge(EList, EList, boolean)
-
merge
public <T> void merge(org.eclipse.emf.common.util.EList<T> externalValue, org.eclipse.emf.common.util.EList<T> internalValue, boolean containment)
MergesinternalValue
byexternalValue
. After updates interanlValue will contains only elements fromexternalValue
in the same order.- Stage 1: finds elements from
internalValue
which's contained inexternalValue
and remember their positions inexternalValue
- Stage 2: add new elements from
externalValue
tointernalValue
and remember their positions inexternalValue
- Stage 3: remove old elements from
internalValue
which is not contained inexternalValue
. And then reordering elements ininternalValue
corresponding toexternalValue
- Parameters:
externalValue
- contains external values, not modified, can't benull
internalValue
- updating values, will be modified in method, can't benull
containment
- true if collections are values of containment feature, false otherwise.
- Stage 1: finds elements from
-
equal
protected boolean equal(Object oldValue, Object newValue)
Used bymerge(EList, EList)
to decide whether the old value is considered equal to the new value.- Parameters:
oldValue
- old value, can benull
newValue
- new value, can benull
- Returns:
true
if oldValue equals newValue,false
otherwise
-
-