ca.uhn.cache.internal.impl
Class ParamSpaceConfig

java.lang.Object
  extended byca.uhn.cache.internal.impl.ParamSpaceConfig
All Implemented Interfaces:
IParamSpaceConfig

public class ParamSpaceConfig
extends java.lang.Object
implements IParamSpaceConfig

Default implementation of IParamSpaceConfig.

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

Constructor Summary
ParamSpaceConfig(IDimension[] theDimensions, IQueryParam[] theAllChunkBoundaries, IQueryParam[] theAllSaturationPoints)
          Constructs ParamSpaceConfig.
 
Method Summary
 IQueryParam[] getChunkBoundaries(IDimension theDimension)
          This method is only meaningful along dimensions for which isChunked() returns true.
 IDimension[] getDimensions()
          
 IQueryParam getSaturationPoint(IDimension theDimension)
          For ordered dimensions, the distances between their members is important. Distances (see IQueryParam.getDistance()) are normalized to between zero and 1. The distance corresponding to 1 is configurable. For example a time dimension may have a relevant range over the last week or the last 20 years. In the first case, a difference of a week would correspond to a distance of 1, and in the second case a difference of 20 years would correspond to 1.
 boolean isChunked(IDimension theDimension)
          True iff data are split into a known list of chunks along this dimension (the usual case). If true, then getChunkBoundaries() must return a list of the boundaries of chunks along this dimension. Dimensions are not always chunked. For example a dimension may correspond to a large, volatile list of values such as person IDs. It would not be efficient to provide a complete list of (possibly millions of) chunk boundaries for such dimensions, or to iterate through them to see which ones are intersected by a query. For such dimensions it is assumed that any valid IQueryParam corresponds to a chunk. For example in an employee ID dimension, it might make sense to have each chunk encompass exactly one ID, in which case this method would return false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamSpaceConfig

public ParamSpaceConfig(IDimension[] theDimensions,
                        IQueryParam[] theAllChunkBoundaries,
                        IQueryParam[] theAllSaturationPoints)
Constructs ParamSpaceConfig.

Parameters:
theDimensions - Dimensions that define a IParamSpace.
theAllChunkBoundaries - (many per dimension) Chunk boundaries for all dimensions. The dimension to which each corresponds is determined by getDimension(). The values are IQueryParam[], to be returned by getChunkBoundaries(). If there are no entries for a certain IDimension then isChunked() will return false.
theAllSaturationPoints - (at most one per dimension) IQueryParam that define the distance 1 (for ordered dimensions only). See IParamSpaceConfig.getSaturationPoint().
Method Detail

getDimensions

public IDimension[] getDimensions()

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

getChunkBoundaries

public IQueryParam[] getChunkBoundaries(IDimension theDimension)
This method is only meaningful along dimensions for which isChunked() returns true.

Specified by:
getChunkBoundaries in interface IParamSpaceConfig
Parameters:
theDimension - a dimension in the space (must be one of those returned by getDimensions()).
Returns:
the limits of each chunk along the given dimension. The whole space must be covered by this list. Returns an empty array if isChunked() returns false for the given dimension.

isChunked

public boolean isChunked(IDimension theDimension)
True iff data are split into a known list of chunks along this dimension (the usual case). If true, then getChunkBoundaries() must return a list of the boundaries of chunks along this dimension. Dimensions are not always chunked. For example a dimension may correspond to a large, volatile list of values such as person IDs. It would not be efficient to provide a complete list of (possibly millions of) chunk boundaries for such dimensions, or to iterate through them to see which ones are intersected by a query. For such dimensions it is assumed that any valid IQueryParam corresponds to a chunk. For example in an employee ID dimension, it might make sense to have each chunk encompass exactly one ID, in which case this method would return false.

Specified by:
isChunked in interface IParamSpaceConfig
Parameters:
theDimension - one of the values returned by getDimensions().
Returns:
true iff data are split into a known list of chunks along this dimension

getSaturationPoint

public IQueryParam getSaturationPoint(IDimension theDimension)
For ordered dimensions, the distances between their members is important. Distances (see IQueryParam.getDistance()) are normalized to between zero and 1. The distance corresponding to 1 is configurable. For example a time dimension may have a relevant range over the last week or the last 20 years. In the first case, a difference of a week would correspond to a distance of 1, and in the second case a difference of 20 years would correspond to 1.

Specified by:
getSaturationPoint in interface IParamSpaceConfig
Parameters:
theDimension - a dimension in this space
Returns:
the param corresponding to a distance of 1, from the origin that is natural for that dimension (e.g. now for a time dimension, 'a' for an alphabetical dimension). Null for non-ordered dimensions.


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