001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.osm; 003 004import java.util.Comparator; 005 006/** 007 * Formats a name for an {@link IPrimitive}. 008 * @since 1990 009 */ 010public interface NameFormatter { 011 012 /** 013 * Formats a name for a {@link INode}. 014 * 015 * @param node the node 016 * @return the name 017 * @since 13564 (signature) 018 */ 019 String format(INode node); 020 021 /** 022 * Formats a name for a {@link IWay}. 023 * 024 * @param way the way 025 * @return the name 026 * @since 13564 (signature) 027 */ 028 String format(IWay way); 029 030 /** 031 * Formats a name for a {@link IRelation}. 032 * 033 * @param relation the relation 034 * @return the name 035 * @since 13564 (signature) 036 */ 037 String format(IRelation relation); 038 039 /** 040 * Formats a name for a {@link Changeset}. 041 * 042 * @param changeset the changeset 043 * @return the name 044 */ 045 String format(Changeset changeset); 046 047 /** 048 * Gets a comparator that sorts the nodes by the string that this formatter would create for them 049 * @return That comparator 050 * @since 13564 (signature) 051 */ 052 Comparator<INode> getNodeComparator(); 053 054 /** 055 * Gets a comparator that sorts the ways by the string that this formatter would create for them 056 * @return That comparator 057 * @since 13564 (signature) 058 */ 059 Comparator<IWay> getWayComparator(); 060 061 /** 062 * Gets a comparator that sorts the relations by the string that this formatter would create for them 063 * @return That comparator 064 * @since 13564 (signature) 065 */ 066 Comparator<IRelation> getRelationComparator(); 067}