Ignore:
Timestamp:
2017-05-16T00:01:44+02:00 (7 years ago)
Author:
michael2402
Message:

See #14794: More javadoc for data.osm package

File:
1 edited

Legend:

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

    r9371 r12190  
    77import java.util.Set;
    88
     9/**
     10 * This is an extension of {@link RelationMember} that stores the parent relation and the index in it in addition to the role/child.
     11 */
    912public class RelationToChildReference {
    1013
     
    4851    private final OsmPrimitive child;
    4952
     53    /**
     54     * Create a new {@link RelationToChildReference}
     55     * @param parent The parent relation
     56     * @param position The position of the child in the parent
     57     * @param role The role of the child
     58     * @param child The actual child (member of parent)
     59     */
    5060    public RelationToChildReference(Relation parent, int position, String role, OsmPrimitive child) {
    5161        this.parent = parent;
     
    5565    }
    5666
     67    /**
     68     * Create a new {@link RelationToChildReference}
     69     * @param parent The parent relation
     70     * @param position The position of the child in the parent
     71     * @param member The role and relation for the child
     72     */
    5773    public RelationToChildReference(Relation parent, int position, RelationMember member) {
    58         this.parent = parent;
    59         this.position = position;
    60         this.role = member.getRole();
    61         this.child = member.getMember();
     74        this(parent, position, member.getRole(), member.getMember());
    6275    }
    6376
     77    /**
     78     * Get the parent relation
     79     * @return The parent
     80     */
    6481    public Relation getParent() {
    6582        return parent;
    6683    }
    6784
     85    /**
     86     * Get the position of the child in the parent
     87     * @return The position of the child
     88     */
    6889    public int getPosition() {
    6990        return position;
    7091    }
    7192
     93    /**
     94     * Get the role of the child
     95     * @return The role
     96     */
    7297    public String getRole() {
    7398        return role;
    7499    }
    75100
     101    /**
     102     * Get the actual child
     103     * @return The child
     104     */
    76105    public OsmPrimitive getChild() {
    77106        return child;
Note: See TracChangeset for help on using the changeset viewer.