Changeset 6804 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2014-02-02T23:35:42+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r6538 r6804 25 25 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 26 26 import org.openstreetmap.josm.data.validation.util.MultipleNameVisitor; 27 import org.openstreetmap.josm.tools.AlphanumComparator; 27 28 28 29 /** … … 300 301 v1.visit(getPrimitives()); 301 302 v2.visit(o.getPrimitives()); 302 return v1.toString().compareToIgnoreCase(v2.toString());303 return AlphanumComparator.getInstance().compare(v1.toString(), v2.toString()); 303 304 } 304 305 -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r6367 r6804 356 356 357 357 private final Comparator<Relation> relationComparator = new Comparator<Relation>() { 358 private final AlphanumComparator ALPHANUM_COMPARATOR = new AlphanumComparator();359 358 @Override 360 359 public int compare(Relation r1, Relation r2) { … … 378 377 String type2 = getRelationTypeName(r2); 379 378 380 int comp = A LPHANUM_COMPARATOR.compare(type1, type2);379 int comp = AlphanumComparator.getInstance().compare(type1, type2); 381 380 if (comp != 0) 382 381 return comp; … … 385 384 String name2 = getRelationName(r2); 386 385 387 comp = A LPHANUM_COMPARATOR.compare(name1, name2);386 comp = AlphanumComparator.getInstance().compare(name1, name2); 388 387 if (comp != 0) 389 388 return comp; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java
r6461 r6804 54 54 private static class AssociatedStreetRoleAddressHouseSorter implements AdditionalSorter { 55 55 56 public static final AlphanumComparator ALPHANUM_COMPARATOR = new AlphanumComparator();57 58 56 @Override 59 57 public boolean acceptsMember(RelationMember m) { … … 66 64 @Override 67 65 public int compare(RelationMember a, RelationMember b) { 68 final int houseNumber = A LPHANUM_COMPARATOR.compare(66 final int houseNumber = AlphanumComparator.getInstance().compare( 69 67 a.getMember().get("addr:housenumber"), 70 68 b.getMember().get("addr:housenumber")); … … 74 72 final String aDisplayName = a.getMember().getDisplayName(DefaultNameFormatter.getInstance()); 75 73 final String bDisplayName = b.getMember().getDisplayName(DefaultNameFormatter.getInstance()); 76 return A LPHANUM_COMPARATOR.compare(aDisplayName, bDisplayName);74 return AlphanumComparator.getInstance().compare(aDisplayName, bDisplayName); 77 75 } 78 76 }); -
trunk/src/org/openstreetmap/josm/tools/AlphanumComparator.java
r6126 r6804 39 39 */ 40 40 public class AlphanumComparator implements Comparator<String> { 41 42 private static final AlphanumComparator INSTANCE = new AlphanumComparator(); 43 44 public static AlphanumComparator getInstance() { 45 return INSTANCE; 46 } 47 48 /** 49 * Constructs a new Alphanum Comparator. 50 * @deprecated use {@link #getInstance()} instead. 51 */ 52 @Deprecated 53 public AlphanumComparator() { 54 } 41 55 42 56 /**
Note:
See TracChangeset
for help on using the changeset viewer.