Community
Participate
Working Groups
private void notifyIfChanged(SetDiff diff) {
if (hasListeners()) {
Set oldSet = cachedSet;
Set newSet = cachedSet = property.getSet(source);
Set newSet;
if (diff == null)
if (diff == null) {
newSet = property.getSet(source);
diff = Diffs.computeSetDiff(oldSet, newSet);
} else {
newSet = new HashSet(oldSet);
diff.applyTo(newSet);
}
cachedSet = newSet;
if (!diff.isEmpty())
fireSetChange(diff);
if (!isDisposed() && !updating) {
getRealm().exec(new Runnable() {
public void run() {
notifyIfChanged((ValueDiff) event.diff);
notifyIfChanged();
});
protected Object doGetValue() {
notifyIfChanged(null);
return property.getValue(source);
updating = false;
private void notifyIfChanged(ValueDiff diff) {
private void notifyIfChanged() {
Object oldValue = cachedValue;
Object newValue = cachedValue = property.getValue(source);
ValueDiff diff = Diffs.createValueDiff(oldValue, newValue);
diff = Diffs.createValueDiff(oldValue, newValue);
if (hasListeners() && !Util.equals(oldValue, newValue)) {
if (!Util.equals(oldValue, newValue))
fireValueChange(diff);
private void notifyIfChanged(ListDiff diff) {
List oldList = cachedList;
List newList = cachedList = property.getList(source);
List newList;
newList = property.getList(source);
diff = Diffs.computeListDiff(oldList, newList);
if (!diff.isEmpty()) {
fireListChange(diff);
newList = new ArrayList(oldList);
diff.applyTo(newList);
cachedList = newList;
private void notifyIfChanged(MapDiff diff) {
Map oldMap = cachedMap;
Map newMap = cachedMap = property.getMap(source);
Map newMap;
newMap = property.getMap(source);
diff = Diffs.computeMapDiff(oldMap, newMap);
newMap = new HashMap(oldMap);
diff.applyTo(newMap);
cachedMap = newMap;
fireMapChange(diff);