Ignore:
Timestamp:
2011-09-17T10:59:32+02:00 (15 years ago)
Author:
jttt
Message:

Custom primitive name formatters via tagging presets

File:
1 edited

Legend:

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

    r4150 r4431  
    1717
    1818public abstract class AbstractPrimitive implements IPrimitive {
    19    
     19
    2020    private static final AtomicLong idCounter = new AtomicLong(0);
    2121
     
    305305        }
    306306    }
    307    
     307
    308308    /**
    309309     * Marks this primitive as being modified.
     
    373373        return (flags & FLAG_VISIBLE) != 0;
    374374    }
    375    
     375
    376376    /**
    377377     * Sets whether this primitive is visible, i.e. whether it is known on the server
     
    414414        return (flags & FLAG_INCOMPLETE) != 0;
    415415    }
    416    
     416
    417417    protected String getFlagsAsString() {
    418418        StringBuilder builder = new StringBuilder();
     
    528528        }
    529529    }
    530    
     530
    531531    /**
    532532     * Remove the given key from the list
     
    589589    }
    590590
     591    public final String getIgnoreCase(String key) {
     592        String[] keys = this.keys;
     593        if (key == null)
     594            return null;
     595        if (keys == null)
     596            return null;
     597        for (int i=0; i<keys.length;i+=2) {
     598            if (keys[i].equalsIgnoreCase(key)) return keys[i+1];
     599        }
     600        return null;
     601    }
     602
    591603    @Override
    592604    public final Collection<String> keySet() {
     
    642654     */
    643655    abstract protected void keysChangedImpl(Map<String, String> originalKeys);
    644    
     656
    645657    /**
    646658     * Replies the name of this primitive. The default implementation replies the value
     
    680692        return getName();
    681693    }
    682    
    683     /**
    684      * Replies the display name of a primitive formatted by <code>formatter</code>
    685      *
    686      * @return the display name
    687      */
    688     @Override
    689     public abstract String getDisplayName(NameFormatter formatter);
    690694
    691695}
Note: See TracChangeset for help on using the changeset viewer.