Permalink
Browse files

change UpdateListener to Entity and change withAll to with-Method

  • Loading branch information...
Stefan Lindel
Stefan Lindel committed Feb 4, 2016
1 parent 21d1490 commit 7e4f85e24f6d5457d61cf73ba0e522d817b15da8
View
@@ -6,3 +6,4 @@
.*AnnotationTest.*
.*FeatureTest.*
.*ProjectBoard.*
+.*
@@ -299,7 +299,7 @@ public static String baseClassName(String typeName, String suffix)
// target object and target attribute name
Object target = objects[i];
String attrName = (String) objects[i+1];
- ObjectSet value = new ObjectSet().with(target, attrName);
+ ObjectSet value = new ObjectSet().withValue(target, attrName);
placeholderTargets.put(placeholder, value);
i += 2;
@@ -11,7 +11,7 @@
import org.sdmlib.serialization.PropertyChangeInterface;
-import de.uniks.networkparser.interfaces.BaseItem;
+import de.uniks.networkparser.interfaces.Entity;
import de.uniks.networkparser.interfaces.UpdateListener;
import de.uniks.networkparser.json.JsonIdMap;
import de.uniks.networkparser.json.JsonObject;
@@ -309,7 +309,7 @@ public FlipBook init(JsonIdMap theMap)
private ArrayList<StepInfo> changes = new ArrayList<StepInfo>();
@Override
- public boolean update(String typ, BaseItem source, PropertyChangeEvent event) {
+ public boolean update(String typ, Entity source, PropertyChangeEvent event) {
if (isReading)
{
// do nothing
@@ -29,7 +29,7 @@
{
if (targetClass.isAssignableFrom(elem.getClass()))
{
- target.withAll(elem);
+ target.with(elem);
}
}
}
@@ -3,9 +3,8 @@
import java.beans.PropertyChangeEvent;
import java.util.Iterator;
import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import de.uniks.networkparser.interfaces.BaseItem;
+import de.uniks.networkparser.interfaces.Entity;
import de.uniks.networkparser.interfaces.SendableEntityCreator;
import de.uniks.networkparser.interfaces.UpdateListener;
import de.uniks.networkparser.json.JsonArray;
@@ -21,8 +20,8 @@
public String secondPropName = null;
@Override
- public boolean update(String typ, BaseItem source, PropertyChangeEvent event) {
- Object tmp = source.getValueItem(JsonIdMap.REMOVE);
+ public boolean update(String typ, Entity source, PropertyChangeEvent event) {
+ Object tmp = source.getValue(JsonIdMap.REMOVE);
if (tmp != null && tmp instanceof JsonObject)
{
@@ -43,7 +42,7 @@ public GenericGraph convert(JsonIdMap idMap, Object root)
GenericGraph graph = new GenericGraph();
LinkedHashMap<String, GenericObject> genObjMap = new LinkedHashMap<String, GenericObject>();
- LinkedHashSet<String> knownLinks = new LinkedHashSet<String>();
+// LinkedHashSet<String> knownLinks = new LinkedHashSet<String>();
MyUpdateListener changeListener = new MyUpdateListener();
idMap.with(changeListener);
@@ -129,7 +129,7 @@ public GenericAttributeSet with(Object value)
{
if (value instanceof java.util.Collection)
{
- this.withAll((Collection<?>)value);
+ this.withList((Collection<?>)value);
}
else if (value != null)
{
@@ -42,7 +42,7 @@ public PatternElementSet getElements()
for (Pattern<?> obj : this)
{
- result.withAll(obj.getElements());
+ result.withList(obj.getElements());
}
return result;
@@ -164,7 +164,7 @@ public ReachabilityGraphSet with(Object value)
{
if (value instanceof java.util.Collection)
{
- this.withAll((Collection<?>)value);
+ this.withList((Collection<?>)value);
}
else if (value != null)
{
@@ -240,7 +240,7 @@ public ReachableStateSet with(Object value)
{
if (value instanceof java.util.Collection)
{
- this.withAll((Collection<?>)value);
+ this.withList((Collection<?>)value);
}
else if (value != null)
{
@@ -39,6 +39,7 @@ and associated documentation files (the "Software"), to deal in the Software wit
import de.uniks.networkparser.EntityUtil;
import de.uniks.networkparser.IdMap;
import de.uniks.networkparser.interfaces.BaseItem;
+import de.uniks.networkparser.interfaces.Entity;
import de.uniks.networkparser.interfaces.SendableEntity;
import de.uniks.networkparser.interfaces.SendableEntityCreator;
import de.uniks.networkparser.interfaces.UpdateListener;
@@ -208,7 +209,7 @@ public long getNewHistoryIdNumber()
@Override
- public boolean update(String typ, BaseItem source, PropertyChangeEvent event) {
+ public boolean update(String typ, Entity source, PropertyChangeEvent event) {
if (mdbListener.isApplyingChangeMsg())
{
// ignore
@@ -54,6 +54,7 @@ and associated documentation files (the "Software"), to deal in the Software wit
import org.sdmlib.serialization.PropertyChangeInterface;
import de.uniks.networkparser.interfaces.BaseItem;
+import de.uniks.networkparser.interfaces.Entity;
import de.uniks.networkparser.interfaces.SendableEntityCreator;
import de.uniks.networkparser.interfaces.UpdateListener;
import de.uniks.networkparser.json.JsonArray;
@@ -540,7 +541,7 @@ public long getNewHistoryIdNumber()
}
@Override
- public boolean update(String typ, BaseItem source, PropertyChangeEvent event) {
+ public boolean update(String typ, Entity source, PropertyChangeEvent event) {
if (isApplyingChangeMsg)
{
// ignore
@@ -46,6 +46,7 @@ and associated documentation files (the "Software"), to deal in the Software wit
import org.sdmlib.serialization.PropertyChangeInterface;
import de.uniks.networkparser.interfaces.BaseItem;
+import de.uniks.networkparser.interfaces.Entity;
import de.uniks.networkparser.interfaces.SendableEntityCreator;
import de.uniks.networkparser.interfaces.UpdateListener;
import de.uniks.networkparser.json.JsonArray;
@@ -350,7 +351,7 @@ else if ("Integer Float Double Long Boolean String"
//==============================================================================
@Override
- public boolean update(String typ, BaseItem item, PropertyChangeEvent event) {
+ public boolean update(String typ, Entity item, PropertyChangeEvent event) {
if (isApplyingChangeMsg)
{
// ignore
@@ -54,7 +54,7 @@ and associated documentation files (the "Software"), to deal in the Software wit
import de.uniks.networkparser.EntityUtil;
import de.uniks.networkparser.SimpleIdCounter;
-import de.uniks.networkparser.interfaces.BaseItem;
+import de.uniks.networkparser.interfaces.Entity;
import de.uniks.networkparser.interfaces.SendableEntityCreator;
import de.uniks.networkparser.interfaces.UpdateListener;
import de.uniks.networkparser.json.JsonIdMap;
@@ -827,7 +827,7 @@ public void setApplyingChangeMsg(boolean isApplyingChangeMsg)
static public int msgNo = 0;
@Override
- public boolean update(String typ, BaseItem source, PropertyChangeEvent event) {
+ public boolean update(String typ, Entity source, PropertyChangeEvent event) {
if (isApplyingChangeMsg)
{
// ignore
@@ -837,14 +837,14 @@ public boolean update(String typ, BaseItem source, PropertyChangeEvent event) {
ReplicationChange change = new ReplicationChange()
.withHistoryIdPrefix(nodeId)
.withHistoryIdNumber(getNewHistoryIdNumber())
- .withTargetObjectId((String) source.getValueItem(JsonIdMap.ID))
+ .withTargetObjectId((String) source.getValue(JsonIdMap.ID))
.withChangeMsg(source.toString());
- Object object = source.getValueItem(JsonIdMap.UPDATE);
+ Object object = source.getValue(JsonIdMap.UPDATE);
if (object == null)
{
- object = source.getValueItem(JsonIdMap.REMOVE);
+ object = source.getValue(JsonIdMap.REMOVE);
}
if (object != null)
@@ -2,7 +2,7 @@
import java.beans.PropertyChangeEvent;
-import de.uniks.networkparser.interfaces.BaseItem;
+import de.uniks.networkparser.interfaces.Entity;
import de.uniks.networkparser.interfaces.SendableEntityCreatorWrapper;
public class PropertyChangeEventWrapper extends SendableEntityCreatorWrapper {
@@ -42,11 +42,11 @@ public Object getValue(Object entity, String attribute) {
}
@Override
- public Object newInstance(BaseItem item) {
- Object source = item.getValueItem(PROPERTY_SOURCE);
- String property = ""+item.getValueItem(PROPERTY_PROPERTY);
- Object oldValue = item.getValueItem(PROPERTY_OLDVALUE);
- Object newValue = item.getValueItem(PROPERTY_NEWVALUE);
+ public Object newInstance(Entity item) {
+ Object source = item.getValue(PROPERTY_SOURCE);
+ String property = ""+item.getValue(PROPERTY_PROPERTY);
+ Object oldValue = item.getValue(PROPERTY_OLDVALUE);
+ Object newValue = item.getValue(PROPERTY_NEWVALUE);
return new PropertyChangeEvent(source, property, oldValue, newValue);
}
}
@@ -79,7 +79,7 @@ public PersonSet without(Person value)
for (Person obj : this)
{
- result.withAll(obj.getName());
+ result.withList(obj.getName());
}
return result;

0 comments on commit 7e4f85e

Please sign in to comment.