ca.uhn.cache.impl
Class StringParam

java.lang.Object
  extended byca.uhn.cache.impl.CommonsLangObject
      extended byca.uhn.cache.impl.AbstractQueryParam
          extended byca.uhn.cache.impl.StringParam
All Implemented Interfaces:
java.lang.Comparable, IPointQueryParam, IQueryParam, java.io.Serializable

public class StringParam
extends AbstractQueryParam
implements IPointQueryParam

A IPointQueryParam that selects data items with values along a certain dimension exactly equal to a certain String value.

Version:
$Revision: 1.1 $ updated on $Date: 2005/01/24 22:52:32 $ by $Author: bryan_tripp $
Author:
Bryan Tripp, Alexei Guevara
See Also:
Serialized Form

Constructor Summary
StringParam(IDimension theDimension, java.lang.String theValue)
          Creates a new StringParam.
 
Method Summary
 float getDistance(IQueryParam theParam, IQueryParam theSaturationPoint)
          Strings are treated as unordered uncategories rather than as with alphabetical order.
 java.lang.String getValue()
           
 boolean intersects(IQueryParam theParam)
          
 IQueryParam merge(IQueryParam theParam)
           
 
Methods inherited from class ca.uhn.cache.impl.AbstractQueryParam
compareTo, compatibleWith, getDimension, getPointParamClass
 
Methods inherited from class ca.uhn.cache.impl.CommonsLangObject
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ca.uhn.cache.IQueryParam
getDimension
 

Constructor Detail

StringParam

public StringParam(IDimension theDimension,
                   java.lang.String theValue)
Creates a new StringParam.

Parameters:
theDimension - The dimension where this parameter is difined.
theValue - The value of this parameter.
Method Detail

intersects

public boolean intersects(IQueryParam theParam)

Specified by:
intersects in interface IQueryParam
Overrides:
intersects in class AbstractQueryParam

getValue

public java.lang.String getValue()
Returns:
Returns the value.

getDistance

public float getDistance(IQueryParam theParam,
                         IQueryParam theSaturationPoint)
Strings are treated as unordered uncategories rather than as with alphabetical order.

Specified by:
getDistance in interface IQueryParam
Parameters:
theParam - must be a StringParam or StringSetParam
theSaturationPoint - ignored
Returns:
0 if the given param is the same, or is contained in a given StringSetParam, 0.5 if it is not (0.5 is similar to the mean distance between random values in an ordered dimension)
See Also:
IQueryParam.getDistance(ca.uhn.cache.IQueryParam, ca.uhn.cache.IQueryParam)

merge

public IQueryParam merge(IQueryParam theParam)
Specified by:
merge in interface IQueryParam
Parameters:
theParam - must be a StringParam or StringSetParam
Returns:
a StringSetParam containing this and the given value(s)
See Also:
IQueryParam.merge(ca.uhn.cache.IQueryParam)


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