Iterator<VALUE> it = getMV();
while(it.hasNext()){
VALUE current = it.next();
DmcAttribute<?> mod = getNew();
mod.add(current);
mods.add(new Modifier(ModifyTypeEnum.ADD, mod));
}
}
else{
for(int index=0; index<getMVSize(); index++){
if (getMVnth(index) != null){
DmcAttribute<?> mod = getNew();
mod.setMVnth(index,getMVnth(index));
mods.add(new Modifier(ModifyTypeEnum.NTH, mod, index));
}
}
}
}
}
else{
if (!adapter.hasValue())
mods.add(new Modifier(ModifyTypeEnum.REM, attrInfo));
else{
// Have to determine the delta
if (attrInfo.indexSize == 0){
Iterator<?> eit = existingValue.getMV();
while(eit.hasNext()){
Object current = eit.next();
if (!contains(current)){
// The value no longer exists, delete it
DmcAttribute<?> mod = getNew();
mod.add(current);
mods.add(new Modifier(ModifyTypeEnum.DEL, mod));
}
}
Iterator<VALUE> it = getMV();
while(it.hasNext()){
VALUE current = it.next();
if (!existingValue.contains(current)){
// The existing value is missing this value, add it
DmcAttribute<?> mod = getNew();
mod.add(current);
mods.add(new Modifier(ModifyTypeEnum.ADD, mod));
}
}
}
else{
for(int index=0; index<getMVSize(); index++){
Object existing = existingValue.getMVnth(index);
Object current = getMVnth(index);
boolean replace = false;
if (existing == null){
if (current != null)
replace = true;
}
else{
if (current == null)
replace = true;
else{
if (!existing.equals(current))
replace = true;
}
}
if (replace){
DmcAttribute<?> mod = getNew();
mod.setMVnth(index,current);
mods.add(new Modifier(ModifyTypeEnum.NTH, mod, index));
}
}
}
}
}