ca.uhn.cache
Interface IQueryParam

All Known Subinterfaces:
IGroupQueryParam, IPointQueryParam
All Known Implementing Classes:
AbstractQueryParam, DateParam, DateRangeParam, StringParam, StringSetParam

public interface IQueryParam

A query parameter that is relevant for caching, i.e. that describes the limits of the query scope along some dimension in a IParamSpace.

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

Method Summary
 IDimension getDimension()
           
 float getDistance(IQueryParam theParam, IQueryParam theSaturationPoint)
           
 boolean intersects(IQueryParam theParam)
           
 IQueryParam merge(IQueryParam theParam)
           
 

Method Detail

getDimension

public IDimension getDimension()
Returns:
the dimension in parameter space to which this IQueryParam belongs

intersects

public boolean intersects(IQueryParam theParam)
Parameters:
theParam - an IQueryParam along the same dimension as this one
Returns:
true iff the given param intersects with this (for example contains, is part of, overlaps)

getDistance

public float getDistance(IQueryParam theParam,
                         IQueryParam theSaturationPoint)
Parameters:
theParam - another IQueryParam
theSaturationPoint - distances are normalized (see below) to between zero and 1. This arg is an IQueryParam that indicates what corresponds to a distance of 1 from the origin. For example consider a date-related dimension in which dates over the last week are relevant. The origin would be now, and the saturation point would be one week ago. This parameter can be ignored, and is allowed to be null, for dimensions that are not ordered.
Returns:
the distance between this IQueryParam and the other. The distance is a number between 0 and 1. It is zero if the two IQueryParam intersect, and 1 if they are at opposite ends of an ordered dimension. For dimensions that correspond to some natural ordering, the distance should increase monotonically with the difference in the ordering property (e.g. with an alphabetical dimension, there should be a greater distance between the A chunk and the C chunk than between A and B chunks). For non-ordered dimensions, the distance between any two non-intersecting IQueryParam may be the same. X.getDistance(Y) == Y.getDistance(X).
Throws:
java.lang.IllegalArgumentException - if the given IQueryParam belongs to a different dimension

merge

public IQueryParam merge(IQueryParam theParam)
Parameters:
theParam - another IQueryParam
Returns:
the result of merging this IQueryParam with the other. This is not necessarily a union. If the dimension has an ordering then the result must encompass all points in both IQueryParam as well as points in between.
Throws:
java.lang.IllegalArgumentException - if the given IQueryParam belongs to a different dimension


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