use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class AbstractEntity method notifyChanged.
protected final void notifyChanged(double oldValue, double newValue) {
if (newValue == oldValue)
return;
FeatureDescriptor fd = CommonsFeatureDescriptorEnum.data_value;
wGetEntityChangeEventHandler().notifyChanged(this, fd, oldValue, newValue);
wGetCompoundChangeEventHandler().notifyChanged(this, fd, oldValue, newValue);
}
use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class CloneOperationOld method updateAdjacencyGraph.
protected void updateAdjacencyGraph() {
for (Map.Entry<IEntity, IEntity> entry : entityCloneMap.entrySet()) {
IEntity entity = entry.getKey();
IEntity entityClone = entry.getValue();
for (int i = entity.wSize(), size = i + entity.wAdjacentSize(); i < size; i++) {
IEntity adjacentEntity = entity.wGet(i);
IEntity adjacentClone = entityCloneMap.get(adjacentEntity);
if (adjacentClone != null)
entityClone.wSet(i, adjacentClone);
else
// TODO enforce shallow copy removal semantics
entityClone.wRemove(i);
}
for (FeatureDescriptor fd : entity.wGetAspectualFeatureDescriptors()) if (fd.isReference()) {
IEntity adjacentEntity = entity.wGet(fd);
IEntity adjacentClone = entityCloneMap.get(adjacentEntity);
if (adjacentClone != null)
entityClone.wSet(fd, adjacentClone);
else
// TODO enforce shallow copy removal semantics
entityClone.wRemove(fd);
}
}
}
use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class CloneOperationOld method cloneDescendantTree.
protected IEntity cloneDescendantTree(IEntity entity) {
IEntity entityClone = entityCloneMap.get(entity);
if (entityClone == null) {
entityClone = ((InternalIEntity) entity).wShallowClone();
entityCloneMap.put(entity, entityClone);
for (// TODO test was int i=entityClone.wSize()-1; i>=0; i--)
int i = 0; // TODO test was int i=entityClone.wSize()-1; i>=0; i--)
i < entityClone.wSize(); // TODO test was int i=entityClone.wSize()-1; i>=0; i--)
i++) cloneAndUpdate(entityClone, i);
for (FeatureDescriptor fd : entity.wGetAspectualFeatureDescriptors()) if (!fd.isReference())
cloneAndUpdate(entityClone, fd);
}
return entityClone;
}
use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class CloneOperation method updateAdjacencyGraph.
protected void updateAdjacencyGraph() {
for (Map.Entry<IEntity, IEntity> entry : entityCloneMap.entrySet()) {
IEntity entity = entry.getKey();
IEntity entityClone = entry.getValue();
for (int i = entity.wSize(), size = i + entity.wAdjacentSize(); i < size; i++) {
IEntity adjacentEntity = entity.wGet(i);
IEntity adjacentClone = entityCloneMap.get(adjacentEntity);
if (adjacentClone != null)
entityClone.wSet(i, adjacentClone);
else
// TODO enforce shallow copy removal semantics
entityClone.wRemove(i);
}
for (FeatureDescriptor fd : entity.wGetAspectualFeatureDescriptors()) if (fd.isReference()) {
IEntity adjacentEntity = entity.wGet(fd);
IEntity adjacentClone = entityCloneMap.get(adjacentEntity);
if (adjacentClone != null)
entityClone.wSet(fd, adjacentClone);
else
// TODO enforce shallow copy removal semantics
entityClone.wRemove(fd);
}
}
}
use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class SimpleEntityImpl method wSet.
public void wSet(int index, IEntity value) {
if (index >= wSize())
throw new IllegalArgumentException();
EntityDescriptor<?> ed = wGetEntityDescriptor();
FeatureDescriptor fd = ed.getEntityFeatureDescriptor(index);
notifyChanged(fd, features[index], features[index] = value.wGetAdapter(fd.getEntityDescriptor()), !fd.isReference());
}
Aggregations