ca.uhn.cache.impl
Class DataItem

java.lang.Object
  extended byca.uhn.cache.impl.CommonsLangObject
      extended byca.uhn.cache.impl.DataItem
All Implemented Interfaces:
IDataItem

public class DataItem
extends CommonsLangObject
implements IDataItem

Represents an individual item stored by a cache. It is only defined in terms of a ParamSpace (see getProjection()).

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

Constructor Summary
DataItem(java.lang.String theId, java.io.Serializable theValue, IQuery theProjection, VolatilityEnum theVolatility, java.util.Date theLastUpdate)
          Constructor
DataItem(java.lang.String theId, java.io.Serializable theValue, IQuery theProjection, VolatilityEnum theVolatility, java.lang.String theLastUpdate)
          Constructor
 
Method Summary
 java.lang.String getId()
          
 java.util.Date getLastUpdate()
          
 IQuery getProjection()
           
 java.io.Serializable getValue()
           
 VolatilityEnum getVolatility()
           
 int hashCode()
          
 void setLastUpdate(java.util.Date theLastUpdate)
          {@inheritDoc}
 
Methods inherited from class ca.uhn.cache.impl.CommonsLangObject
equals, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataItem

public DataItem(java.lang.String theId,
                java.io.Serializable theValue,
                IQuery theProjection,
                VolatilityEnum theVolatility,
                java.lang.String theLastUpdate)
         throws java.text.ParseException
Constructor

Parameters:
theId - The item's unique identifier.
theValue - The domain specific item to wrap with this object
theProjection - The location of the item in the associated IParamSpace
theVolatility - The item's volatility (has an impact on the item's TTL in the cache).
theLastUpdate - The time the item was last updated in the source system represented as a string, where the format is (MMM dd, yyyy h:mm a). If this is unknown, and set to null, this class will set it to the current time
Throws:
java.text.ParseException - If theLastUpdate date/time could not be parsed.

DataItem

public DataItem(java.lang.String theId,
                java.io.Serializable theValue,
                IQuery theProjection,
                VolatilityEnum theVolatility,
                java.util.Date theLastUpdate)
Constructor

Parameters:
theId - The item's unique identifier.
theValue - The domain specific item to wrap with this object
theProjection - The location of the item in the associated IParamSpace
theVolatility - The item's volatility (has an impact on the item's TTL in the cache).
theLastUpdate - The time the item was last updated in the source system. If this is unknown, and set to null, this class will set it to the current time
Method Detail

getProjection

public IQuery getProjection()
Specified by:
getProjection in interface IDataItem
Returns:
the location of the IDataItem in the (implicitly) associated IParamSpace

getVolatility

public VolatilityEnum getVolatility()
Specified by:
getVolatility in interface IDataItem
Returns:
the item's volatility

getValue

public java.io.Serializable getValue()
Specified by:
getValue in interface IDataItem
Returns:
the domain-specific value wrapped by this IDataItem

getLastUpdate

public java.util.Date getLastUpdate()

Specified by:
getLastUpdate in interface IDataItem
Returns:
the time at which the item was last updated (recent end of possible range if unknown)

getId

public java.lang.String getId()

Specified by:
getId in interface IDataItem
Returns:
a unique ID for the data item (assigned by the IDataSource that created this IDataItem)

setLastUpdate

public void setLastUpdate(java.util.Date theLastUpdate)
{@inheritDoc}


hashCode

public int hashCode()

Overrides:
hashCode in class CommonsLangObject


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