net.sf.jagg
Class AggregatorCache

java.lang.Object
  extended by net.sf.jagg.AggregatorCache

public class AggregatorCache
extends java.lang.Object

Created as a wrapper around a HashMap that maps aggregator specification strings to Lists of Aggregators.

Since:
0.3.0
Author:
Randy Gettman

Method Summary
 Aggregator getAggregator(Aggregator archetype)
          Adds the given Aggregator to an internal cache.
static AggregatorCache getAggregatorCache()
          Returns the singleton AggregatorCache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAggregatorCache

public static AggregatorCache getAggregatorCache()
Returns the singleton AggregatorCache.

Returns:
The singleton AggregatorCache.

getAggregator

public Aggregator getAggregator(Aggregator archetype)
Adds the given Aggregator to an internal cache. If it's not in use, then it marks it as "in use" and returns it. Else, it searches the cache for an Aggregator that matches the given Aggregator and is not already in use. If none exist in the cache, then it replicates the given Aggregator, adds it to the cache, and returns it.

Parameters:
archetype - The Aggregator whose properties (and type) need to be matched.
Returns:
A matching Aggregator object. It could be archetype itself if it's not already in use, or it could be null if archetype was null.


Copyright © 2010-2013 jAgg Team. All Rights Reserved.