Ignore:
Timestamp:
2008-01-30T18:02:38+01:00 (16 years ago)
Author:
gebner
Message:

Part one of patch by Dave Hansen <dave@…>

  • Remove unused imports
  • Main.debug
  • Make attribute merging aware of TIGER-import attributes
  • Better upload progress information
  • Retry uploads
File:
1 edited

Legend:

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

    r357 r529  
    77
    88import org.openstreetmap.josm.data.osm.visitor.Visitor;
     9import org.openstreetmap.josm.tools.Pair;
    910
    1011/**
     
    1920         */
    2021        public final List<Node> nodes = new ArrayList<Node>();
     22
     23        public void visitNodes(Visitor v) {
     24                for (Node n : this.nodes)
     25                        v.visit(n);
     26        }
     27
     28        public ArrayList<Pair<Node,Node>> getNodePairs(boolean sort) {
     29                ArrayList<Pair<Node,Node>> chunkSet = new ArrayList<Pair<Node,Node>>();
     30                Node lastN = null;
     31                for (Node n : this.nodes) {
     32            if (lastN == null) {
     33                    lastN = n;
     34                        continue;
     35                    }
     36                        Pair<Node,Node> np = new Pair<Node,Node>(lastN, n);
     37                if (sort) {
     38                        Pair.sort(np);
     39                }
     40                chunkSet.add(np);
     41                lastN = n;
     42                }
     43                return chunkSet;
     44        }
     45
    2146
    2247        @Override public void visit(Visitor visitor) {
Note: See TracChangeset for help on using the changeset viewer.