/** * Adds a new key/value pair into this map. If the key is not yet in the map, it gets added to the map and the call is * equal to put(Object,Object). * * @param key the key. * @param val the value. * @return true, if the value has been added, false otherwise */ public boolean add( final K key, final V val ) { final List<V> v = this.table.get( key ); if ( v == null ) { put( key, val ); return true; } else { return v.add( val ); } }
/** * Adds a new key/value pair into this map. If the key is not yet in the * map, it gets added to the map and the call is equal to * put(Object,Object). * * @param key the key. * @param val the value. * @return true, if the value has been added, false otherwise */ public boolean add(final K key, final V val) { final List<V> v = this.table.get(key); if (v == null) { put(key, val); return true; } else { return v.add(val); } }
public DynamicStyleRootBandAnalyzer( final HashNMap<String, StyleKey> styleByElementName, final HashNMap<InstanceID, StyleKey> styleById ) { this.styleByElementName = styleByElementName; this.dynamicTemplateInfo = new HashNMap<InstanceID, StyleKey>(); for ( final InstanceID id : styleById.keySet() ) { Iterator<StyleKey> it = styleById.getAll( id ); while ( it.hasNext() ) { this.dynamicTemplateInfo.put( id, it.next() ); } } }
protected void inspectElement( final ReportElement element ) { dynamicTemplateInfo.add( element.getObjectID(), ElementStyleKeys.VISIBLE ); String name = element.getName(); if ( styleByElementName.containsKey( name ) ) { Iterator<StyleKey> it = styleByElementName.getAll( name ); while ( it.hasNext() ) { this.dynamicTemplateInfo.put( element.getObjectID(), it.next() ); } } traverseStyleExpressions( element ); }