Ignore:
Timestamp:
2009-12-09T21:24:32+01:00 (15 years ago)
Author:
Gubaer
Message:

comment to follow in a later commit
Have to break up a commit because of SSL problem in SVN (filed a ticket - #4093)

Location:
trunk/src/org/openstreetmap/josm/data
Files:
7 edited

Legend:

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

    r2512 r2598  
    1414import java.util.logging.Logger;
    1515
     16import org.openstreetmap.josm.actions.upload.CyclicUploadDependencyException;
    1617import org.openstreetmap.josm.data.osm.DataSet;
    1718import org.openstreetmap.josm.data.osm.Node;
     
    2122import org.openstreetmap.josm.data.osm.Way;
    2223
    23 import org.openstreetmap.josm.actions.upload.CyclicUploadDependencyException;
    24 
    2524/**
    2625 * Represents a collection of {@see OsmPrimitive}s which should be uploaded to the
    2726 * API.
    28  * The collection is derived from the modified primitives of an {@see DataSet}.
     27 * The collection is derived from the modified primitives of an {@see DataSet} and it provides methods
     28 * for sorting the objects in upload order.
    2929 *
    3030 */
     
    212212
    213213    /**
     214     * Replies the number of objects to upload
     215     *
     216     * @return the number of objects to upload
     217     */
     218    public int getSize() {
     219        return toAdd.size() + toUpdate.size() + toDelete.size();
     220    }
     221
     222    public void removeProcessed(Collection<OsmPrimitive> processed) {
     223        if (processed == null) return;
     224        toAdd.removeAll(processed);
     225        toUpdate.removeAll(processed);
     226        toDelete.removeAll(processed);
     227    }
     228
     229    /**
    214230     * Adjusts the upload order for new relations. Child relations are uploaded first,
    215231     * parent relations second.
  • trunk/src/org/openstreetmap/josm/data/osm/Changeset.java

    r2512 r2598  
    11// License: GPL. Copyright 2007 by Martijn van Oosterhout and others
    22package org.openstreetmap.josm.data.osm;
    3 
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    53
    64import java.util.Collection;
     
    10098    }
    10199
    102     public String getLocalName(){
    103         return tr("Changeset {0}",getId());
    104     }
    105 
    106100    public String getDisplayName(NameFormatter formatter) {
    107101        return formatter.format(this);
     
    308302        return tags.keySet();
    309303    }
     304
     305    public boolean isNew() {
     306        return id <= 0;
     307    }
    310308}
  • trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java

    r2512 r2598  
    173173    }
    174174
     175    public boolean isNew() {
     176        return id <= 0;
     177    }
    175178}
  • trunk/src/org/openstreetmap/josm/data/osm/PrimitiveId.java

    r2399 r2598  
    55
    66    long getUniqueId();
    7 
    87    OsmPrimitiveType getType();
    98
     9    /**
     10     * Replies true if this id represents a new primitive.
     11     *
     12     * @return true if this id represents a new primitive.
     13     */
     14    boolean isNew();
     15
    1016}
  • trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java

    r2399 r2598  
    171171        return member.getUniqueId();
    172172    }
     173
     174    public boolean isNew() {
     175        return member.isNew();
     176    }
    173177}
  • trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java

    r2404 r2598  
    5151    }
    5252
     53    public boolean isNew() {
     54        return memberId <= 0;
     55    }
    5356}
  • trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java

    r2448 r2598  
    1818    public long getUniqueId() {
    1919        return id;
     20    }
     21
     22    public boolean isNew() {
     23        return id <= 0;
    2024    }
    2125
Note: See TracChangeset for help on using the changeset viewer.