Ignore:
Timestamp:
2023-10-12T22:32:39+02:00 (12 months ago)
Author:
taylor.smock
Message:

See #16207: Keep track of download area for notes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/NoteData.java

    r18208 r18868  
    77import java.util.Collections;
    88import java.util.Comparator;
     9import java.util.HashSet;
    910import java.util.List;
    1011import java.util.Map;
     12import java.util.Set;
    1113
    1214import org.openstreetmap.josm.data.Data;
     
    5355    private final ListenerList<NoteDataUpdateListener> listeners = ListenerList.create();
    5456
     57    private final Set<DataSource> dataSourceSet = new HashSet<>();
     58
    5559    /**
    5660     * Construct a new note container without notes
     
    140144        if (this != from) {
    141145            addNotes(from.noteList);
     146            from.getDataSources().forEach(this::addDataSource);
    142147        }
    143148    }
     
    315320    @Override
    316321    public Collection<DataSource> getDataSources() {
    317         return Collections.emptyList(); // Notes don't currently store data sources
     322        return Collections.unmodifiableSet(this.dataSourceSet);
     323    }
     324
     325    /**
     326     * Adds a new data source.
     327     * @param source data source to add
     328     * @return {@code true} if the collection changed as a result of the call
     329     * @since 18868
     330     */
     331    public synchronized boolean addDataSource(DataSource source) {
     332        return this.dataSourceSet.add(source);
    318333    }
    319334}
Note: See TracChangeset for help on using the changeset viewer.