Changeset 13665 in josm
- Timestamp:
- 2018-04-23T21:57:10+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/INode.java
r13564 r13665 31 31 32 32 @Override 33 default int compareTo(IPrimitive o) { 34 return o instanceof INode ? Long.compare(getUniqueId(), o.getUniqueId()) : 1; 35 } 36 37 @Override 33 38 default String getDisplayName(NameFormatter formatter) { 34 39 return formatter.format(this); -
trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
r13664 r13665 11 11 * @since 4098 12 12 */ 13 public interface IPrimitive extends Tagged, PrimitiveId, Stylable { 13 public interface IPrimitive extends Tagged, PrimitiveId, Stylable, Comparable<IPrimitive> { 14 14 15 15 /** … … 147 147 * </ul> 148 148 * @return {@code true} if this object is drawable 149 * @since xxx149 * @since 13664 150 150 */ 151 151 default boolean isDrawable() { … … 156 156 * Determines whether the primitive is selected 157 157 * @return whether the primitive is selected 158 * @since xxx158 * @since 13664 159 159 */ 160 160 default boolean isSelected() { … … 165 165 * Determines if this primitive is a member of a selected relation. 166 166 * @return {@code true} if this primitive is a member of a selected relation, {@code false} otherwise 167 * @since xxx167 * @since 13664 168 168 */ 169 169 default boolean isMemberOfSelected() { … … 174 174 * Determines if this primitive is an outer member of a selected multipolygon relation. 175 175 * @return {@code true} if this primitive is an outer member of a selected multipolygon relation, {@code false} otherwise 176 * @since xxx176 * @since 13664 177 177 */ 178 178 default boolean isOuterMemberOfSelected() { -
trunk/src/org/openstreetmap/josm/data/osm/IRelation.java
r13564 r13665 46 46 47 47 @Override 48 default int compareTo(IPrimitive o) { 49 return o instanceof IRelation ? Long.compare(getUniqueId(), o.getUniqueId()) : -1; 50 } 51 52 @Override 48 53 default String getDisplayName(NameFormatter formatter) { 49 54 return formatter.format(this); -
trunk/src/org/openstreetmap/josm/data/osm/IWay.java
r13564 r13665 44 44 45 45 @Override 46 default int compareTo(IPrimitive o) { 47 if (o instanceof IRelation) 48 return 1; 49 return o instanceof IWay ? Long.compare(getUniqueId(), o.getUniqueId()) : -1; 50 } 51 52 @Override 46 53 default String getDisplayName(NameFormatter formatter) { 47 54 return formatter.format(this); -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r13564 r13665 312 312 313 313 @Override 314 public int compareTo(OsmPrimitive o) {315 return o instanceof Node ? Long.compare(getUniqueId(), o.getUniqueId()) : 1;316 }317 318 @Override319 314 public OsmPrimitiveType getType() { 320 315 return OsmPrimitiveType.NODE; -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r13664 r13665 42 42 * @author imi 43 43 */ 44 public abstract class OsmPrimitive extends AbstractPrimitive implements Comparable<OsmPrimitive>,TemplateEngineDataProvider {44 public abstract class OsmPrimitive extends AbstractPrimitive implements TemplateEngineDataProvider { 45 45 private static final String SPECIAL_VALUE_ID = "id"; 46 46 private static final String SPECIAL_VALUE_LOCAL_NAME = "localname"; -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r13564 r13665 318 318 } 319 319 320 @Override321 public int compareTo(OsmPrimitive o) {322 return o instanceof Relation ? Long.compare(getUniqueId(), o.getUniqueId()) : -1;323 }324 325 320 /** 326 321 * Returns the first member. -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r13564 r13665 333 333 } 334 334 return true; 335 }336 337 @Override338 public int compareTo(OsmPrimitive o) {339 if (o instanceof Relation)340 return 1;341 return o instanceof Way ? Long.compare(getUniqueId(), o.getUniqueId()) : -1;342 335 } 343 336
Note:
See TracChangeset
for help on using the changeset viewer.