org.das2.dataset
Class CacheTag

java.lang.Object
  extended by org.das2.dataset.CacheTag

public class CacheTag
extends java.lang.Object

CacheTags are used to represent the coverage of datasets stored in a cache, and are the reference used to decide if a cache entry is capable of satisfying a data request.


Field Summary
static java.lang.String INTRINSIC
           
 
Constructor Summary
CacheTag(Datum start, Datum end, Datum resolution)
          Constructs a new CacheTag.
CacheTag(DatumRange range, Datum resolution)
          Constucts a new CacheTag.
 
Method Summary
static CacheTag append(CacheTag tag1, CacheTag tag2)
          Appends two CacheTags, when possible.
 boolean contains(CacheTag tag)
          Indicates if the cache tag the the capability of satifying the given cache tag.
 DatumRange getRange()
          the range covered by the cache tag.
 Datum getResolution()
          the resolution of the cache tag, which may be null.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INTRINSIC

public static final java.lang.String INTRINSIC
See Also:
Constant Field Values
Constructor Detail

CacheTag

public CacheTag(Datum start,
                Datum end,
                Datum resolution)
Constructs a new CacheTag.

Parameters:
start - the beginning of the interval.
end - the end of the interval.
resolution - the highest resolution request that can be provided.

CacheTag

public CacheTag(DatumRange range,
                Datum resolution)
Constucts a new CacheTag.

Parameters:
range - the interval covered by the CacheTag.
resolution - the highest resolution request that can be provided.
Method Detail

append

public static CacheTag append(CacheTag tag1,
                              CacheTag tag2)
Appends two CacheTags, when possible. The new range covers the ranges, and the resolution is the lower of the two.

Parameters:
tag1 - a CacheTag
tag2 - a CacheTag that is adjacent to tag1
Returns:
a CacheTag that covers both CacheTags precisely.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a human consumable representation of the cache tag. This should fit on one line as it is used to list cache contents.

contains

public boolean contains(CacheTag tag)
Indicates if the cache tag the the capability of satifying the given cache tag. If the tag has a lower (courser) resolution and its bounds are within this CacheTag.

Parameters:
tag - a CacheTag to test.
Returns:
true if the tag has a lower resolution and its bounds are within this CacheTag.

getRange

public DatumRange getRange()
the range covered by the cache tag.


getResolution

public Datum getResolution()
the resolution of the cache tag, which may be null.