|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.timeindexing.cache.DefaultIndexCache
The default implementation of a cache which holds the index items.
Constructor Summary | |
DefaultIndexCache(ManagedIndex index)
Create a DefaultIndexCache object. |
Method Summary | |
long |
addItem(IndexItem item,
long position)
Add an Index Item to the Index. |
long |
addItem(IndexItem item,
Position position)
Add an Index Item to the Index. |
boolean |
clear()
Clear the whole cache This does nothing by default as the data will be lost. |
boolean |
containsItem(long pos)
Contains the IndexItem at the speicifed position. |
boolean |
containsItem(Position p)
Contains the IndexItem at the speicifed position. |
long |
getDataVolume()
Get the current data volume held by IndexItems in this cache. |
Timestamp |
getFirstDataTime()
Get the time the first IndexItem was put into the Index. |
Timestamp |
getFirstIndexTime()
Get the time the first IndexItem was put into the Index. |
IndexItem |
getItem(long pos)
Get an Index Item from the Index. |
IndexItem |
getItem(Position p)
Get an Index Item from the Index. |
Timestamp |
getLastDataTime()
Get the time the last IndexItem was put into the Index. |
Timestamp |
getLastIndexTime()
Get the time the last IndexItem was put into the Index. |
CachePolicy |
getPolicy()
Get the current cache policy. |
boolean |
hollowItem(long pos)
Hollow the IndexItem at the position. |
boolean |
hollowItem(Position p)
Hollow the IndexItem at the position. |
boolean |
removeItem(long pos)
Remove the IndexItem at the speicifed position. |
boolean |
removeItem(Position p)
Remove the IndexItem at the speicifed position. |
CachePolicy |
setPolicy(CachePolicy pol)
Set the cache policy. |
long |
size()
Get the no of items in the cache |
protected long |
sparce(long start,
long end)
Create some sparce elements in the cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultIndexCache(ManagedIndex index)
Method Detail |
public long size()
size
in interface IndexCache
public long addItem(IndexItem item, Position position)
addItem
in interface IndexCache
item
- the IndexItem to add
public long addItem(IndexItem item, long position)
addItem
in interface IndexCache
item
- the IndexItem to add
public IndexItem getItem(long pos)
getItem
in interface IndexCache
public IndexItem getItem(Position p)
getItem
in interface IndexCache
public boolean containsItem(long pos)
containsItem
in interface IndexCache
public boolean containsItem(Position p)
containsItem
in interface IndexCache
public boolean hollowItem(long pos)
hollowItem
in interface IndexCache
public boolean hollowItem(Position p)
hollowItem
in interface IndexCache
public boolean removeItem(long pos)
removeItem
in interface IndexCache
public boolean removeItem(Position p)
removeItem
in interface IndexCache
public boolean clear()
clear
in interface IndexCache
public long getDataVolume()
getDataVolume
in interface IndexCache
public Timestamp getFirstIndexTime()
getFirstIndexTime
in interface IndexCache
public Timestamp getLastIndexTime()
getLastIndexTime
in interface IndexCache
public Timestamp getFirstDataTime()
getFirstDataTime
in interface IndexCache
public Timestamp getLastDataTime()
getLastDataTime
in interface IndexCache
public CachePolicy setPolicy(CachePolicy pol)
setPolicy
in interface IndexCache
public CachePolicy getPolicy()
getPolicy
in interface IndexCache
protected long sparce(long start, long end)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |