Changeset 522 in josm for trunk/src


Ignore:
Timestamp:
2008-01-13T23:41:49+01:00 (17 years ago)
Author:
gebner
Message:

SearchCompiler: "nodes:n" searches for ways with n nodes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r517 r522  
    145145        }
    146146
     147        private static class NodeCount extends Match {
     148                private int count;
     149                public NodeCount(int count) {this.count = count;}
     150                @Override public boolean match(OsmPrimitive osm) {
     151                        return osm instanceof Way && ((Way) osm).nodes.size() == count;
     152                }
     153                @Override public String toString() {return "nodes="+count;}
     154        }
     155
    147156        private static class Modified extends Match {
    148157                @Override public boolean match(OsmPrimitive osm) {
     
    261270                } else if (key.equals("user")) {
    262271                        return new UserMatch(value);
     272                } else if (key.equals("nodes")) {
     273                        return new NodeCount(Integer.parseInt(value));
    263274                } else if (key.equals("id")) {
    264275                        try {
Note: See TracChangeset for help on using the changeset viewer.