Changeset 9881 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks
- Timestamp:
- 2016-02-25T01:51:43+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTask.java
r9241 r9881 71 71 this.targetLayer = targetLayer; 72 72 parents = new DataSet(); 73 }74 75 /**76 * constructor77 *78 * @param targetLayer the target layer for the downloaded primitives. Must not be null.79 * @param children the collection of children for which parents are to be downloaded. Children80 * are specified by their id and their type.81 */82 public DownloadReferrersTask(OsmDataLayer targetLayer, Map<Long, OsmPrimitiveType> children) {83 super("Download referrers", false /* don't ignore exception*/);84 CheckParameterUtil.ensureParameterNotNull(targetLayer, "targetLayer");85 canceled = false;86 this.children = new HashMap<>();87 if (children != null) {88 for (Entry<Long, OsmPrimitiveType> entry : children.entrySet()) {89 if (entry.getKey() > 0 && entry.getValue() != null) {90 children.put(entry.getKey(), entry.getValue());91 }92 }93 }94 this.targetLayer = targetLayer;95 parents = new DataSet();96 }97 98 /**99 * constructor100 *101 * @param targetLayer the target layer. Must not be null.102 * @param id the primitive id. id > 0 required.103 * @param type the primitive type. type != null required104 * @throws IllegalArgumentException if id <= 0105 * @throws IllegalArgumentException if type == null106 * @throws IllegalArgumentException if targetLayer == null107 */108 public DownloadReferrersTask(OsmDataLayer targetLayer, long id, OsmPrimitiveType type) {109 super("Download referrers", false /* don't ignore exception*/);110 CheckParameterUtil.ensureParameterNotNull(targetLayer, "targetLayer");111 if (id <= 0)112 throw new IllegalArgumentException(MessageFormat.format("Id > 0 required, got {0}", id));113 CheckParameterUtil.ensureParameterNotNull(type, "type");114 canceled = false;115 this.children = new HashMap<>();116 this.children.put(id, type);117 this.targetLayer = targetLayer;118 parents = new DataSet();119 }120 121 /**122 * constructor123 *124 * @param targetLayer the target layer. Must not be null.125 * @param primitiveId a PrimitiveId object.126 * @throws IllegalArgumentException if id <= 0127 * @throws IllegalArgumentException if targetLayer == null128 */129 public DownloadReferrersTask(OsmDataLayer targetLayer, PrimitiveId primitiveId) {130 this(targetLayer, primitiveId, null);131 73 } 132 74
Note:
See TracChangeset
for help on using the changeset viewer.