OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 132 Rev 177
Line 49... Line 49...
49
    // use static
49
    // use static
50
    protected CollectionChangeEvent(Object source, String propertyName, Collection<?> oldValue, Collection<?> newValue) {
50
    protected CollectionChangeEvent(Object source, String propertyName, Collection<?> oldValue, Collection<?> newValue) {
51
        super(source, propertyName, oldValue, newValue);
51
        super(source, propertyName, oldValue, newValue);
52
    }
52
    }
53
 
53
 
-
 
54
    @Override
-
 
55
    public Collection<?> getOldValue() {
-
 
56
        // checked by constructor
-
 
57
        return (Collection<?>) super.getOldValue();
-
 
58
    }
-
 
59
 
-
 
60
    @Override
-
 
61
    public Collection<?> getNewValue() {
-
 
62
        // checked by constructor
-
 
63
        return (Collection<?>) super.getNewValue();
-
 
64
    }
-
 
65
 
54
    public Collection getItemsAdded() {
66
    public Collection getItemsAdded() {
55
        return CollectionUtils.subtract((Collection<?>) this.getNewValue(), (Collection<?>) this.getOldValue());
67
        return CollectionUtils.subtract(this.getNewValue(), this.getOldValue());
56
    }
68
    }
57
 
69
 
58
    public Collection getItemsRemoved() {
70
    public Collection getItemsRemoved() {
59
        return CollectionUtils.subtract((Collection<?>) this.getOldValue(), (Collection<?>) this.getNewValue());
71
        return CollectionUtils.subtract(this.getOldValue(), this.getNewValue());
60
    }
72
    }
61
 
73
 
62
    public Collection getItemsNotChanged() {
74
    public Collection getItemsNotChanged() {
63
        return CollectionUtils.intersection((Collection<?>) this.getNewValue(), (Collection<?>) this.getOldValue());
75
        return CollectionUtils.intersection(this.getNewValue(), this.getOldValue());
64
    }
76
    }
65
 
77
 
66
    /**
78
    /**
67
     * Does the new collection is the old one plus some items.
79
     * Does the new collection is the old one plus some items.
68
     * 
80
     *