Ignore:
Timestamp:
03.02.2010 22:53:24 (2 years ago)
Author:
mjulius
Message:

bring PrimitiveData.getId() in line with OsmPrimitive.getId()
remove OsmReader.OsmPrimitiveData and use PrimitiveData instead

File:
1 edited

Legend:

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

    r2906 r2932  
    223223    } 
    224224 
    225     protected OsmPrimitive(PrimitiveData data) { 
    226         version = data.getVersion(); 
    227         id = data.getId(); 
     225    /** 
     226     * Creates a new primitive for the given id and version. 
     227     * 
     228     * If allowNegativeId is set, provided id can be < 0 and will be set to primitive without any processing. 
     229     * If allowNegativeId is not set, then id will have to be 0 (in that case new unique id will be generated) or 
     230     * positive number. 
     231     *  
     232     * If id is not > 0 version is ignored and set to 0. 
     233     * 
     234     * @param id 
     235     * @param version 
     236     * @param allowNegativeId 
     237     * @throws IllegalArgumentException thrown if id < 0 and allowNegativeId is false 
     238     */ 
     239    protected OsmPrimitive(long id, int version, boolean allowNegativeId) throws IllegalArgumentException { 
     240        this(id, allowNegativeId); 
     241        this.version = (id > 0 ? version : 0); 
    228242    } 
    229243 
     
    11611175    public void load(PrimitiveData data) { 
    11621176        setKeys(data.getKeys()); 
    1163         timestamp = data.getTimestamp(); 
     1177        setTimestamp(data.getTimestamp()); 
    11641178        user = data.getUser(); 
    11651179        setChangesetId(data.getChangesetId()); 
     
    11801194        data.getKeys().clear(); 
    11811195        data.getKeys().putAll(getKeys()); 
    1182         data.setTimestamp(timestamp); 
     1196        data.setTimestamp(getTimestamp()); 
    11831197        data.setUser(user); 
    11841198        data.setDeleted(isDeleted()); 
Note: See TracChangeset for help on using the changeset viewer.