Changeset 11332 in josm


Ignore:
Timestamp:
2016-11-28T01:49:49+01:00 (7 years ago)
Author:
Don-vip
Message:

javadoc

File:
1 edited

Legend:

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

    r11121 r11332  
    103103    }
    104104
     105    /**
     106     * Visitor pattern.
     107     * @param v visitor
     108     */
    105109    public void visit(Visitor v) {
    106110        v.visit(this);
    107111    }
    108112
     113    /**
     114     * Compares this changeset to another, based on their identifier.
     115     * @param other other changeset
     116     * @return the value {@code 0} if {@code getId() == other.getId()};
     117     *         a value less than {@code 0} if {@code getId() < other.getId()}; and
     118     *         a value greater than {@code 0} if {@code getId() > other.getId()}
     119     */
    109120    public int compareTo(Changeset other) {
    110121        return Integer.compare(getId(), other.getId());
    111122    }
    112123
     124    /**
     125     * Returns the changeset name.
     126     * @return the changeset name (untranslated: "changeset &lt;identifier&gt;")
     127     */
    113128    public String getName() {
    114129        // no translation
     
    116131    }
    117132
     133    /**
     134     * Returns the changeset display name, as per given name formatter.
     135     * @param formatter name formatter
     136     * @return the changeset display name, as per given name formatter
     137     */
    118138    public String getDisplayName(NameFormatter formatter) {
    119139        return formatter.format(this);
    120140    }
    121141
     142    /**
     143     * Returns the changeset identifier.
     144     * @return the changeset identifier
     145     */
    122146    public int getId() {
    123147        return id;
    124148    }
    125149
     150    /**
     151     * Sets the changeset identifier.
     152     * @param id changeset identifier
     153     */
    126154    public void setId(int id) {
    127155        this.id = id;
    128156    }
    129157
     158    /**
     159     * Returns the changeset user.
     160     * @return the changeset user
     161     */
    130162    public User getUser() {
    131163        return user;
    132164    }
    133165
     166    /**
     167     * Sets the changeset user.
     168     * @param user changeset user
     169     */
    134170    public void setUser(User user) {
    135171        this.user = user;
    136172    }
    137173
     174    /**
     175     * Returns the changeset creation date.
     176     * @return the changeset creation date
     177     */
    138178    public Date getCreatedAt() {
    139179        return createdAt;
    140180    }
    141181
     182    /**
     183     * Sets the changeset creation date.
     184     * @param createdAt changeset creation date
     185     */
    142186    public void setCreatedAt(Date createdAt) {
    143187        this.createdAt = createdAt;
    144188    }
    145189
     190    /**
     191     * Returns the changeset closure date.
     192     * @return the changeset closure date
     193     */
    146194    public Date getClosedAt() {
    147195        return closedAt;
    148196    }
    149197
     198    /**
     199     * Sets the changeset closure date.
     200     * @param closedAt changeset closure date
     201     */
    150202    public void setClosedAt(Date closedAt) {
    151203        this.closedAt = closedAt;
    152204    }
    153205
     206    /**
     207     * Determines if this changeset is open.
     208     * @return {@code true} if this changeset is open
     209     */
    154210    public boolean isOpen() {
    155211        return open;
    156212    }
    157213
     214    /**
     215     * Sets whether this changeset is open.
     216     * @param open {@code true} if this changeset is open
     217     */
    158218    public void setOpen(boolean open) {
    159219        this.open = open;
    160220    }
    161221
     222    /**
     223     * Returns the min lat/lon of the changeset bounding box.
     224     * @return the min lat/lon of the changeset bounding box
     225     */
    162226    public LatLon getMin() {
    163227        return min;
    164228    }
    165229
     230    /**
     231     * Sets the min lat/lon of the changeset bounding box.
     232     * @param min min lat/lon of the changeset bounding box
     233     */
    166234    public void setMin(LatLon min) {
    167235        this.min = min;
    168236    }
    169237
     238    /**
     239     * Returns the max lat/lon of the changeset bounding box.
     240     * @return the max lat/lon of the changeset bounding box
     241     */
    170242    public LatLon getMax() {
    171243        return max;
    172244    }
    173245
     246    /**
     247     * Sets the max lat/lon of the changeset bounding box.
     248     * @param max min lat/lon of the changeset bounding box
     249     */
     250    public void setMax(LatLon max) {
     251        this.max = max;
     252    }
     253
     254    /**
     255     * Returns the changeset bounding box.
     256     * @return the changeset bounding box
     257     */
    174258    public Bounds getBounds() {
    175259        if (min != null && max != null)
    176260            return new Bounds(min, max);
    177261        return null;
    178     }
    179 
    180     public void setMax(LatLon max) {
    181         this.max = max;
    182262    }
    183263
     
    217297    }
    218298
     299    /**
     300     * Determines if this changeset is incomplete.
     301     * @return {@code true} if this changeset is incomplete
     302     */
    219303    public boolean isIncomplete() {
    220304        return incomplete;
    221305    }
    222306
     307    /**
     308     * Sets whether this changeset is incomplete
     309     * @param incomplete {@code true} if this changeset is incomplete
     310     */
    223311    public void setIncomplete(boolean incomplete) {
    224312        this.incomplete = incomplete;
     
    249337    }
    250338
     339    /**
     340     * Determines if this changeset has equals semantic attributes with another one.
     341     * @param other other changeset
     342     * @return {@code true} if this changeset has equals semantic attributes with other changeset
     343     */
    251344    public boolean hasEqualSemanticAttributes(Changeset other) {
    252345        if (other == null)
     
    315408    }
    316409
     410    /**
     411     * Determines if this changeset is new.
     412     * @return {@code true} if this changeset is new ({@code id <= 0})
     413     */
    317414    public boolean isNew() {
    318415        return id <= 0;
    319416    }
    320417
     418    /**
     419     * Merges changeset metadata from another changeset.
     420     * @param other other changeset
     421     */
    321422    public void mergeFrom(Changeset other) {
    322423        if (other == null)
     
    339440    }
    340441
     442    /**
     443     * Determines if this changeset has contents.
     444     * @return {@code true} if this changeset has contents
     445     */
    341446    public boolean hasContent() {
    342447        return content != null;
    343448    }
    344449
     450    /**
     451     * Returns the changeset contents.
     452     * @return the changeset contents, can be null
     453     */
    345454    public ChangesetDataSet getContent() {
    346455        return content;
    347456    }
    348457
     458    /**
     459     * Sets the changeset contents.
     460     * @param content changeset contents, can be null
     461     */
    349462    public void setContent(ChangesetDataSet content) {
    350463        this.content = content;
Note: See TracChangeset for help on using the changeset viewer.