Changeset 6010 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2013-06-16T13:41:18+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #8799 - Follow conventional visitor design pattern by renaming visit(Visitor) to accept(Visitor) (missing files from previous commit)

Location:
trunk/src/org/openstreetmap/josm/data
Files:
9 edited

Legend:

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

    r2578 r6010  
    4848            if (m.isNode()) visit(m.getNode());
    4949    }
     50   
    5051    /**
    51      * @return All nodes the given primitive has.
     52     * Replies all nodes contained by the given primitives
     53     * @param osms The OSM primitives to inspect
     54     * @return All nodes the given primitives have.
    5255     */
    5356    public static Collection<Node> getAllNodes(Collection<? extends OsmPrimitive> osms) {
    5457        AllNodesVisitor v = new AllNodesVisitor();
    5558        for (OsmPrimitive osm : osms)
    56             osm.visit(v);
     59            osm.accept(v);
    5760        return v.nodes;
    5861    }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java

    r4129 r6010  
    4040        for (RelationMember m : e.getMembers()) {
    4141            if (!m.isRelation()) {
    42                 m.getMember().visit(this);
     42                m.getMember().accept(this);
    4343            }
    4444        }
     
    130130                continue;
    131131            }
    132             p.visit(this);
     132            p.accept(this);
    133133        }
    134134    }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java

    r5360 r6010  
    134134        //
    135135        for (Node n: w.getNodes()) {
    136             n.visit(this);
     136            n.accept(this);
    137137        }
    138138        // ... and the way itself
     
    152152            }
    153153            if (isInSelectionBase(member.getMember()) || member.getMember().isNew()) {
    154                 member.getMember().visit(this);
     154                member.getMember().accept(this);
    155155            } else {
    156156                rememberIncomplete(member.getMember());
     
    185185    public DataSet build() {
    186186        for (OsmPrimitive primitive: selectionBase.getAllSelected()) {
    187             primitive.visit(this);
     187            primitive.accept(this);
    188188        }
    189189        buildHull();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/PrimitiveVisitor.java

    r5927 r6010  
    66import org.openstreetmap.josm.data.osm.IWay;
    77
     8/**
     9 * OSM primitives interfaces visitor, following conventional <a href="http://en.wikipedia.org/wiki/Visitor_pattern">visitor design pattern</a>.
     10 * @since 4100
     11 */
    812public interface PrimitiveVisitor {
     13   
     14    /**
     15     * Visiting call for points.
     16     * @param n The node to inspect.
     17     */
    918    void visit(INode n);
     19   
     20    /**
     21     * Visiting call for lines.
     22     * @param w The way to inspect.
     23     */
    1024    void visit(IWay w);
    11     void visit(IRelation e);
     25
     26    /**
     27     * Visiting call for relations.
     28     * @param r The relation to inspect.
     29     */
     30    void visit(IRelation r);
    1231}
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/Visitor.java

    r5421 r6010  
    1010 * Implementation of the visitor scheme. Every @{link org.openstreetmap.josm.data.OsmPrimitive}
    1111 * can be visited by several different visitors.
     12 * @since 8
    1213 */
    1314public interface Visitor {
     
    2021     * Visiting call for lines.
    2122     * @param w The way to inspect.
     23     * @since 64
    2224     */
    2325    void visit(Way w);
    2426    /**
    2527     * Visiting call for relations.
    26      * @param e The relation to inspect.
     28     * @param r The relation to inspect.
     29     * @since 343
    2730     */
    28     void visit(Relation e);
     31    void visit(Relation r);
    2932    /**
    3033     * Visiting call for changesets.
    3134     * @param cs The changeset to inspect.
     35     * @since 1523
    3236     */
    3337    void visit(Changeset cs);
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java

    r5881 r6010  
    161161        for (final Relation rel : data.searchRelations(bbox)) {
    162162            if (rel.isDrawable() && !ds.isSelected(rel) && !rel.isDisabledAndHidden()) {
    163                 rel.visit(this);
     163                rel.accept(this);
    164164            }
    165165        }
     
    176176                    untaggedWays.add(way);
    177177                } else {
    178                     way.visit(this);
     178                    way.accept(this);
    179179                }
    180180            }
     
    185185        for (List<Way> specialWays : Arrays.asList(new List[]{untaggedWays, highlightedWays})) {
    186186            for (final Way way : specialWays){
    187                 way.visit(this);
     187                way.accept(this);
    188188            }
    189189            specialWays.clear();
     
    193193        for (final OsmPrimitive osm : data.getSelected()) {
    194194            if (osm.isDrawable()) {
    195                 osm.visit(this);
     195                osm.accept(this);
    196196            }
    197197        }
     
    201201            if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden())
    202202            {
    203                 osm.visit(this);
     203                osm.accept(this);
    204204            }
    205205        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java

    r5287 r6010  
    4848        for (OsmPrimitive p : selection) {
    4949            if (p.isUsable() && p instanceof Node) {
    50                 p.visit(this);
     50                p.accept(this);
    5151            }
    5252        }
  • trunk/src/org/openstreetmap/josm/data/validation/util/AggregatePrimitivesVisitor.java

    r4075 r6010  
    3030    public Collection<OsmPrimitive> visit(Collection<OsmPrimitive> data) {
    3131        for (OsmPrimitive osm : data) {
    32             osm.visit(this);
     32            osm.accept(this);
    3333        }
    3434
     
    5858            aggregatedData.add(r);
    5959            for (RelationMember m : r.getMembers()) {
    60                 m.getMember().visit(this);
     60                m.getMember().accept(this);
    6161            }
    6262        }
  • trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java

    r5911 r6010  
    5050            }
    5151
    52             osm.visit(this);
     52            osm.accept(this);
    5353            if (multipleClassname == null) {
    5454                multipleClassname = className;
Note: See TracChangeset for help on using the changeset viewer.