Ignore:
Timestamp:
2009-09-06T23:07:33+02:00 (15 years ago)
Author:
Gubaer
Message:

new: rewrite of CombineWay action
new: conflict resolution dialog for CombineWay, including conflicts for different relation memberships
cleanup: cleanup in OsmReader, reduces memory footprint and reduces parsing time
cleanup: made most of the public fields in OsmPrimitive @deprecated, added accessors and changed the code
cleanup: replaced usages of @deprecated constructors for ExtendedDialog
fixed #3208: Combine ways brokes relation order

WARNING: this changeset touches a lot of code all over the code base. "latest" might become slightly unstable in the next days. Also experience incompatibility issues with plugins in the next few days.

File:
1 edited

Legend:

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

    r2017 r2070  
    119119
    120120    /**
     121     * Creates a new way with id 0.
     122     *
     123     */
     124    public Way(){
     125    }
     126
     127    /**
    121128     * Create an identical clone of the argument (including the id).
    122129     *
     
    124131     */
    125132    public Way(Way original) {
     133        super(original.getId());
    126134        cloneFrom(original);
    127135    }
    128136
    129137    /**
    130      * Create an empty way without id. Use this only if you set meaningful
    131      * values yourself.
    132      */
    133     public Way() {
    134     }
    135 
    136     /**
    137      * Create an incomplete Way with a given id.
    138      *
    139      * @param id  the id. id > 0 required.
    140      */
    141     public Way(long id) {
    142         // FIXME: shouldn't we check for id > 0?
    143         //
    144         this.id = id;
    145         incomplete = true;
     138     * Creates a new way for the given id. If the id > 0, the way is marked
     139     * as incomplete.
     140     *
     141     * @param id the id. > 0 required
     142     * @throws IllegalArgumentException thrown if id < 0
     143     */
     144    public Way(long id) throws IllegalArgumentException {
     145        super(id);
    146146    }
    147147
     
    153153
    154154    @Override public String toString() {
    155         if (incomplete) return "{Way id="+id+" version="+version+" (incomplete)}";
    156         return "{Way id="+id+" version="+version+" nodes="+Arrays.toString(nodes.toArray())+"}";
     155        if (incomplete) return "{Way id="+getId()+" version="+getVersion()+" (incomplete)}";
     156        return "{Way id="+getId()+" version="+getVersion()+" nodes="+Arrays.toString(nodes.toArray())+"}";
    157157    }
    158158
     
    170170        if (o instanceof Relation)
    171171            return 1;
    172         return o instanceof Way ? Long.valueOf(id).compareTo(o.id) : -1;
     172        return o instanceof Way ? Long.valueOf(getId()).compareTo(o.getId()) : -1;
    173173    }
    174174
Note: See TracChangeset for help on using the changeset viewer.