Skip to content

Commit

Permalink
made adjustems to IdMap to allow IdMap Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
PCopei committed May 17, 2017
1 parent b5432f2 commit 18174e1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/de/uniks/networkparser/IdMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -1627,11 +1627,34 @@ else if (item instanceof Iterable<?>) {
this.withCreator((SendableEntityCreator) value);
}
}
if(item instanceof IdMap) {
IdMap oldIDMap = (IdMap) item;
this.withSession(oldIDMap.getSession());
this.withTimeStamp(oldIDMap.getTimeStamp());
SimpleKeyValueList<String, Object> objects = oldIDMap.getKeyValue();
for(int z=0;z<objects.size();z++) {
String id = objects.get(z);
Object value = objects.getValueByIndex(z);
this.put(id, value);
}
this.withGrammar(oldIDMap.getGrammar());
this.withFilter(oldIDMap.getFilter());

this.withListener(oldIDMap.getUpdateListener());
}
}
}
return true;
}

public Filter getFilter() {
return filter;
}

public ObjectCondition getUpdateListener() {
return updateListener;
}

public IdMap withTimeStamp(long newValue) {
this.timeStamp = newValue;
return this;
Expand Down

0 comments on commit 18174e1

Please sign in to comment.