Changeset 4734 in josm for trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
- Timestamp:
- 2011-12-28T20:40:46+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
r3083 r4734 22 22 * It can either download the object including or not including its immediate children. 23 23 * The former case is called a "full download". 24 * 25 * It can also download a specific version of the object (however, "full" download is not possible 26 * in that case). 24 27 * 25 28 */ … … 29 32 /** true if a full download is required, i.e. a download including the immediate children */ 30 33 private boolean full; 34 /** the specific version number, if required (incompatible with full), or -1 else */ 35 private int version; 31 36 32 37 /** … … 41 46 */ 42 47 public OsmServerObjectReader(long id, OsmPrimitiveType type, boolean full) throws IllegalArgumentException { 48 this(id, type, full, -1); 49 } 50 51 /** 52 * Creates a new server object reader for a given id and a primitive type. 53 * 54 * @param id the object id. > 0 required. 55 * @param type the type. Must not be null. 56 * @param version the specific version number, if required; -1, otherwise 57 * @throws IllegalArgumentException thrown if id <= 0 58 * @throws IllegalArgumentException thrown if type is null 59 */ 60 public OsmServerObjectReader(long id, OsmPrimitiveType type, int version) throws IllegalArgumentException { 61 this(id, type, false, version); 62 } 63 64 protected OsmServerObjectReader(long id, OsmPrimitiveType type, boolean full, int version) throws IllegalArgumentException { 43 65 if (id <= 0) 44 66 throw new IllegalArgumentException(MessageFormat.format("Expected value > 0 for parameter ''{0}'', got {1}", "id", id)); … … 46 68 this.id = new SimplePrimitiveId(id, type); 47 69 this.full = full; 70 this.version = version; 48 71 } 49 72 … … 58 81 */ 59 82 public OsmServerObjectReader(PrimitiveId id, boolean full) { 83 this(id, full, -1); 84 } 85 86 /** 87 * Creates a new server object reader for an object with the given <code>id</code> 88 * 89 * @param id the object id. Must not be null. Unique id > 0 required. 90 * @param version the specific version number, if required; -1, otherwise 91 * @throws IllegalArgumentException thrown if id is null 92 * @throws IllegalArgumentException thrown if id.getUniqueId() <= 0 93 */ 94 public OsmServerObjectReader(PrimitiveId id, int version) { 95 this(id, false, version); 96 } 97 98 protected OsmServerObjectReader(PrimitiveId id, boolean full, int version) { 60 99 CheckParameterUtil.ensureValidPrimitiveId(id, "id"); 61 100 this.id = id; 62 101 this.full = full; 102 this.version = version; 63 103 } 64 104 … … 87 127 if (full && ! id.getType().equals(OsmPrimitiveType.NODE)) { 88 128 sb.append("/full"); 129 } else if (version > 0) { 130 sb.append("/"+version); 89 131 } 90 132
Note:
See TracChangeset
for help on using the changeset viewer.