Code example for ConcurrentSkipListMap

Methods: getput

0
    public void clear() { 
        models.clear();
    } 
 
    private synchronized ConcurrentSkipListMap<String, AbstractGraphRow> getRowsMap(String vizualizerName) {
        ConcurrentSkipListMap<String, AbstractGraphRow> rows = models.get(vizualizerName);
        if (rows == null) {
            rows = new ConcurrentSkipListMap<String, AbstractGraphRow>();
            models.put(vizualizerName, rows);
        } 
        return rows;
    } 
 
    public void addRow(String vizualizerName, AbstractGraphRow row) {
        ConcurrentSkipListMap<String, AbstractGraphRow> rows = models.get(vizualizerName);
        if (rows == null) {
            rows = getRowsMap(vizualizerName);
        } 
        rows.put(row.getLabel(), row);
        notifier.refresh();
    }