ca.uhn.cache.impl
Class ParamSpace

java.lang.Object
  extended byca.uhn.cache.impl.ParamSpace
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, IParamSpace

public class ParamSpace
extends java.lang.Object
implements IParamSpace, org.springframework.beans.factory.InitializingBean

A multi-dimensional space of IQueryParams. A data item has a location in this space (see IDataInspector). Data items are divided into IChunks that represent regions of the space.

Version:
$Revision: 1.1 $ updated on $Date: 2005/01/24 22:52:39 $ by $Author: bryan_tripp $
Author:
Bryan Tripp

Constructor Summary
ParamSpace()
           
 
Method Summary
 void afterPropertiesSet()
          
 IQueryParam[] chunk(IQueryParam theParam)
          TODO: this assumes that chunk sizes along a given dimension are independent of other dimensions, but this may not be feasible. For example, possibly sparse data (e.g. ECG should be divided into longer time spans than oft-collected data (e.g. CBC), in order to have an efficient number of data items per chunk. RESOLUTION: allow multiple caches in SelfCachingDataSource
static ParamSpace createInstance(IParamSpaceConfig theParamSpaceConfig)
          Factory method.
 IDimension[] getDimensions()
          
 IParamSpaceConfig getParamSpaceConfig()
           
 IQuery[] group(IQuery[] theQueries, int theMaxGroups)
          Given a list of queries, finds a small set of queries that includes all of them, without including too many queries that aren't in the list. There may be a trade-off between number of queries returned and extra queries included. For example, one query could be returned for each original query, in which case no extra queries would be included. On the other hand a single query could be returnd which covers the whole IParamSpace. Good solutions lie somewhere between these extremes.
 void setParamSpaceConfig(IParamSpaceConfig theConfigData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamSpace

public ParamSpace()
Method Detail

createInstance

public static ParamSpace createInstance(IParamSpaceConfig theParamSpaceConfig)
Factory method.

Parameters:
theParamSpaceConfig - The configuration information for this space (defining dimensions, etc).
Returns:
The created ParamSpace.

getDimensions

public IDimension[] getDimensions()

Specified by:
getDimensions in interface IParamSpace
Returns:
a list of dimensions according to which data are chunked.

chunk

public IQueryParam[] chunk(IQueryParam theParam)
TODO: this assumes that chunk sizes along a given dimension are independent of other dimensions, but this may not be feasible. For example, possibly sparse data (e.g. ECG should be divided into longer time spans than oft-collected data (e.g. CBC), in order to have an efficient number of data items per chunk. RESOLUTION: allow multiple caches in SelfCachingDataSource

Specified by:
chunk in interface IParamSpace
Parameters:
theParam - a IQueryParam
Returns:
a list of IQueryParams that together encompasses the given IQueryParam, each of which corresponds to the size of a IChunk.

group

public IQuery[] group(IQuery[] theQueries,
                      int theMaxGroups)
Given a list of queries, finds a small set of queries that includes all of them, without including too many queries that aren't in the list. There may be a trade-off between number of queries returned and extra queries included. For example, one query could be returned for each original query, in which case no extra queries would be included. On the other hand a single query could be returnd which covers the whole IParamSpace. Good solutions lie somewhere between these extremes.

Specified by:
group in interface IParamSpace
Parameters:
theQueries - a list of IQueryies to be covered by the returned IQuerys
theMaxGroups - maximum number of IQuerys returned (lower numbers will generally force more extra chunks to be spanned)
Returns:
a list of IQuerys that include all the specified chunks

getParamSpaceConfig

public IParamSpaceConfig getParamSpaceConfig()
Returns:
The configuration information for this space (defining dimensions, etc).

setParamSpaceConfig

public void setParamSpaceConfig(IParamSpaceConfig theConfigData)
Parameters:
theConfigData - The configData to set.

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception


Copyright © 2004-2005 University Health Network. All Rights Reserved.