Changeset 12190 in josm


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

See #14794: More javadoc for data.osm package

Location:
trunk/src/org/openstreetmap/josm/data/osm
Files:
10 edited

Legend:

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

    r11940 r12190  
    307307    }
    308308
     309    /**
     310     * Gets the type this primitive is displayed at
     311     * @return A {@link OsmPrimitiveType}
     312     */
    309313    public OsmPrimitiveType getDisplayType() {
    310314        return getType();
     
    669673    }
    670674
     675    /**
     676     * Gets a key ignoring the case of the key
     677     * @param key The key to get
     678     * @return The value for a key that matches the given key ignoring case.
     679     */
    671680    public final String getIgnoreCase(String key) {
    672681        String[] keys = this.keys;
     
    681690    }
    682691
     692    /**
     693     * Gets the number of keys
     694     * @return The number of keys set for this primitive.
     695     */
    683696    public final int getNumKeys() {
    684697        String[] keys = this.keys;
  • trunk/src/org/openstreetmap/josm/data/osm/BBox.java

    r12183 r12190  
    299299    }
    300300
     301    /**
     302     * Converts the bounds to a rectangle
     303     * @return The rectangle in east/north space.
     304     */
    301305    public Rectangle2D toRectangle() {
    302306        return new Rectangle2D.Double(xmin, ymin, xmax - xmin, ymax - ymin);
     
    339343    }
    340344
     345    /**
     346     * Creates a CSV string for this bbox
     347     * @param separator The separator to use
     348     * @return A string
     349     */
    341350    public String toStringCSV(String separator) {
    342351        return Utils.join(separator, Arrays.asList(
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetCacheListener.java

    r10600 r12190  
    22package org.openstreetmap.josm.data.osm;
    33
     4/**
     5 * A listener that listens to changes on the {@link ChangesetCache}
     6 * @see ChangesetCacheEvent
     7 */
    48@FunctionalInterface
    59public interface ChangesetCacheListener {
    610
     11    /**
     12     * Gets notified on changeset cache updates
     13     * @param event The event that happened
     14     */
    715    void changesetCacheUpdated(ChangesetCacheEvent event);
    816}
  • trunk/src/org/openstreetmap/josm/data/osm/NodeData.java

    r12161 r12190  
    77import org.openstreetmap.josm.data.projection.Projections;
    88
     9/**
     10 * The data on a single node (tags and position) that is stored in the database
     11 */
    912public class NodeData extends PrimitiveData implements INode {
    1013
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r12188 r12190  
    10141014    }
    10151015
     1016    /**
     1017     * Gets a list of all primitives in the current dataset that reference this primitive.
     1018     * @return The referrers
     1019     */
    10161020    public final List<OsmPrimitive> getReferrers() {
    10171021        return getReferrers(false);
  • trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java

    r11452 r12190  
    77import org.openstreetmap.josm.tools.CheckParameterUtil;
    88
     9/**
     10 * This is the data (role, type and id) that is stored in the database for a given relation member.
     11 */
    912public class RelationMemberData implements PrimitiveId, Serializable {
    1013
  • 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;
  • trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java

    r10300 r12190  
    1010import java.util.regex.Pattern;
    1111
     12/**
     13 * A primitive id and a primitive type
     14 */
    1215public class SimplePrimitiveId implements PrimitiveId, Serializable {
    1316
     
    1720    private final OsmPrimitiveType type;
    1821
     22    /**
     23     * A pattern that is used to parse a textual primitive id
     24     */
    1925    public static final Pattern ID_PATTERN = Pattern.compile("(n|node|w|way|r|rel|relation)[ /]?(\\d+)");
    2026
     27    /**
     28     * A pattern that is used to parse an id range
     29     */
    2130    public static final Pattern MULTIPLE_IDS_PATTERN = Pattern.compile(ID_PATTERN.pattern() + "(-(\\d+))?");
    2231
     32    /**
     33     * Create a new primtive id
     34     * @param id The id
     35     * @param type The type of the primitive
     36     */
    2337    public SimplePrimitiveId(long id, OsmPrimitiveType type) {
    2438        this.id = id;
  • trunk/src/org/openstreetmap/josm/data/osm/WayData.java

    r12017 r12190  
    33
    44import java.util.ArrayList;
     5import java.util.Collections;
    56import java.util.List;
    67
    78import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
    89
     10/**
     11 * The data (tags and node ids) that is stored for a way in the database
     12 */
    913public class WayData extends PrimitiveData implements IWay {
    1014
     
    3741    }
    3842
     43    /**
     44     * Gets a list of nodes the way consists of
     45     * @return The ids of the nodes
     46     */
    3947    public List<Long> getNodes() {
    40         return nodes;
     48        return Collections.unmodifiableList(nodes);
    4149    }
    4250
     
    5765    }
    5866
     67    /**
     68     * Sets the nodes array
     69     * @param nodes The nodes this way consists of
     70     */
    5971    public void setNodes(List<Long> nodes) {
    6072        this.nodes = new ArrayList<>(nodes);
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java

    r12189 r12190  
    197197    }
    198198
     199    /**
     200     * Gets a unsorted set of all changeset ids that were used by the primitives in this data set
     201     * @return The ids
     202     */
    199203    public Collection<Long> getChangesetIds() {
    200204        final Set<Long> ids = new HashSet<>();
Note: See TracChangeset for help on using the changeset viewer.