Changeset 2188 in josm for trunk/src/org
- Timestamp:
- 2009-09-26T09:43:40+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r2168 r2188 28 28 * The collection is derived from the modified primitives of an {@see DataSet}. 29 29 * 30 *31 30 */ 32 31 public class APIDataSet { … … 45 44 46 45 /** 47 * initializes the API data set with the modified primitives in <code>ds</ ds>48 * 49 * @param ds the data set. Ignore , if null.46 * initializes the API data set with the modified primitives in <code>ds</code> 47 * 48 * @param ds the data set. Ignored, if null. 50 49 */ 51 50 public void init(DataSet ds) { … … 63 62 } else if (osm.isModified() && !osm.isDeleted()) { 64 63 toUpdate.addLast(osm); 65 } else if (osm.isDeleted() && osm.getId() != 0 ) {64 } else if (osm.isDeleted() && osm.getId() != 0 && osm.isModified()) { 66 65 toDelete.addFirst(osm); 67 66 } … … 70 69 71 70 /** 72 * initializes the API data set with the modified primitives in <code>ds</ ds>73 * 74 * @param ds the data set. Ignore , if null.71 * initializes the API data set with the modified primitives in <code>ds</code> 72 * 73 * @param ds the data set. Ignored, if null. 75 74 */ 76 75 public APIDataSet(DataSet ds) { -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2181 r2188 35 35 abstract public class OsmPrimitive implements Comparable<OsmPrimitive>, Tagged { 36 36 37 /** 38 * Replies the sub-collection of {@see OsmPrimitive}s of type <code>type</code> present in 39 * another collection of {@see OsmPrimitive}s. The result collection is a list. 40 * 41 * If <code>list</code> is null, replies an empty list. 42 * 43 * @param <T> 44 * @param list the original list 45 * @param type the type to filter for 46 * @return the sub-list of OSM primitives of type <code>type</code> 47 */ 37 48 static public <T extends OsmPrimitive> List<T> getFilteredList(Collection<OsmPrimitive> list, Class<T> type) { 38 if (list == null) return null;49 if (list == null) return Collections.emptyList(); 39 50 List<T> ret = new LinkedList<T>(); 40 51 for(OsmPrimitive p: list) { … … 46 57 } 47 58 59 /** 60 * Replies the sub-collection of {@see OsmPrimitive}s of type <code>type</code> present in 61 * another collection of {@see OsmPrimitive}s. The result collection is a set. 62 * 63 * If <code>list</code> is null, replies an empty set. 64 * 65 * @param <T> 66 * @param list the original collection 67 * @param type the type to filter for 68 * @return the sub-set of OSM primitives of type <code>type</code> 69 */ 48 70 static public <T extends OsmPrimitive> Set<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) { 49 if (set == null) return null;71 if (set == null) return Collections.emptySet(); 50 72 HashSet<T> ret = new HashSet<T>(); 51 73 for(OsmPrimitive p: set) { … … 91 113 * An id of 0 means an unknown id. The object has not been uploaded yet to 92 114 * know what id it will get. 93 *94 * Do not write to this attribute except you know exactly what you are doing.95 * More specific, it is not good to set this to 0 and think the object is now96 * new to the server! To create a new object, call the default constructor of97 * the respective class.98 115 * 99 116 */ … … 742 759 */ 743 760 public abstract String getDisplayName(NameFormatter formatter); 744 745 761 } 746 747
Note:
See TracChangeset
for help on using the changeset viewer.