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() ); } } }
public void addError( final String parameterName, final ValidationMessage message ) { if ( parameterName == null ) { throw new NullPointerException(); } if ( message == null ) { throw new NullPointerException(); } propertyMessages.add( parameterName, message ); }
private HashMap<InstanceID, StyleKey[]> buildStash() { HashMap<InstanceID, StyleKey[]> stash = new HashMap<InstanceID, StyleKey[]>(); for ( final InstanceID id : this.dynamicTemplateInfo.keySet() ) { int valueCount = this.dynamicTemplateInfo.getValueCount( id ); StyleKey[] styleKeys = this.dynamicTemplateInfo.toArray( id, new StyleKey[valueCount] ); stash.put( id, styleKeys ); } return stash; }
public ValidationMessage[] getErrors( final String parameter ) { return (ValidationMessage[]) propertyMessages.toArray( parameter, new ValidationMessage[propertyMessages .getValueCount( parameter )] ); }
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 ); }
public String[] getFunctionNamesByCategory(final FunctionCategory category) { return categoryFunctions.toArray(category, EMPTY_ARRAY); }
/** * 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 ); } }
/** * Retrieves the first value registered for an key or null if there was no such key in the list. * * @param key the key. * @return the value. */ public V getFirst( final K key ) { return get( key, 0 ); }
/** * Inserts a new key/value pair into the map. If such a pair already exists, it gets replaced with the given values. * * @param key the key. * @param val the value. * @return A boolean. */ public boolean put( final K key, final V val ) { final List<V> v = this.table.get( key ); if ( v == null ) { final List<V> newList = createList(); newList.add( val ); this.table.put( key, newList ); return true; } else { v.clear(); return v.add( val ); } }
public void compute( final Section rootLevelBand ) { this.dynamicTemplateInfo.clear(); inspectElement( rootLevelBand ); traverseSection( rootLevelBand ); HashMap<InstanceID, StyleKey[]> stash = buildStash(); rootLevelBand.setAttribute( AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.FAST_EXPORT_DYNAMIC_STASH, stash ); }
public ValidationResult() { propertyMessages = new HashNMap(); messages = new ArrayList(); }
public String[] getFunctionNamesByCategory( final FunctionCategory category ) { return categoryFunctions.toArray( category, EMPTY_ARRAY ); }
/** * 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); } }
/** * Retrieves the first value registered for an key or null if there was no * such key in the list. * * @param key the key. * @return the value. */ public V getFirst(final K key) { return get(key, 0); }
/** * Inserts a new key/value pair into the map. If such a pair already * exists, it gets replaced with the given values. * * @param key the key. * @param val the value. * @return A boolean. */ public boolean put(final K key, final V val) { final List<V> v = this.table.get(key); if (v == null) { final List<V> newList = createList(); newList.add(val); this.table.put(key, newList); return true; } else { v.clear(); return v.add(val); } }
private void handleTrafficLightFunction( final ElementTrafficLightFunction rb ) { String element = rb.getElement(); if ( element == null ) { return; } if ( rb.isDefineBackground() ) { styleByElementName.add( element, ElementStyleKeys.BACKGROUND_COLOR ); } else { styleByElementName.add( element, ElementStyleKeys.PAINT ); } }
public DefaultFunctionRegistry() { cachedFunctions = new HashMap<String, Class>(); categoryFunctions = new HashNMap<FunctionCategory, String>(); functionMetaData = new HashMap<String, FunctionDescription>(); functions = new HashMap<String, String>(); categories = EMPTY_CATEGORIES; }
public Function[] getFunctionsByCategory( final FunctionCategory category ) { final String[] fnNames = categoryFunctions.toArray( category, EMPTY_ARRAY ); final ArrayList<Function> functions = new ArrayList<Function>( fnNames.length ); for ( int i = 0; i < fnNames.length; i++ ) { final String aName = fnNames[ i ]; final Function function = createFunction( aName ); if ( function != null ) { functions.add( function ); } } return functions.toArray( new Function[ functions.size() ] ); }
protected void inspectStyleExpression( final ReportElement element, final StyleKey styleKey, final Expression expression, final ExpressionMetaData expressionMetaData ) { dynamicTemplateInfo.add( element.getObjectID(), styleKey ); } }