|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.timeindexing.index.AbstractIndex
public abstract class AbstractIndex
An abstract implementation of an Index object. It represents the index header, the index stream and the data stream.
| Constructor Summary | |
|---|---|
protected |
AbstractIndex()
|
| Method Summary | |
|---|---|
void |
addAccessEventListener(IndexAccessEventListener l)
Add a IndexAccessEventListener. |
void |
addAddEventListener(IndexAddEventListener l)
Add a IndexAddEventListener. |
boolean |
addDataType(ID typeID,
java.lang.String typeName)
Add a new data type |
abstract IndexItem |
addItem(DataItem item)
Add a Data Item to the Index. |
abstract IndexItem |
addItem(DataItem item,
Timestamp dataTime)
Add a Data Item to the Index with a speicifed Data Timestamp |
abstract IndexItem |
addItem(DataItem item,
Timestamp dataTime,
long annotation)
Add a Data Item to the Index with a speicifed Data Timestamp and some annotation data |
protected IndexItem |
addItem(IndexItem item)
Add an Index Item to the Index. |
void |
addPrimaryEventListener(IndexPrimaryEventListener l)
Add a IndexPrimaryEventListener. |
abstract IndexItem |
addReference(IndexItem item,
Index other)
Add a Reference to an IndexItem in a Index. |
abstract IndexItem |
addReference(IndexItem item,
Index other,
Timestamp dataTime)
Add a Reference to an IndexItem in a Index. |
abstract IndexItem |
addReference(IndexItem item,
Index other,
Timestamp dataTime,
long annotation)
Add a Reference to an IndexItem in a Index. |
DoubleLinkedList |
apply(Function fn)
Apply a function to all of the IndexItems, resulting in a List of results. |
protected TimestampMapping |
binarySearch(Timestamp t,
long start,
long end,
IndexTimestampSelector selector,
Lifetime lifetime,
int depth)
Do a binary search of the list. |
boolean |
commit()
Commit all changes to the index. |
boolean |
contains(Timestamp t)
Does a timestamp fall within the bounds of the Index. |
boolean |
contains(Timestamp t,
IndexTimestampSelector selector)
Does a timestamp fall within the bounds of the Index. |
IndexEventMulticaster |
eventMulticaster()
Get the event listener. |
IndexView |
filter(Function fn)
Filter some IndexItems out into a new IncoreIndex. |
int |
getAnnotationStyle()
Get the annotation style. |
IndexCache |
getCache()
Get the current Cache. |
CachePolicy |
getCachePolicy()
Get the current CachePolicy. |
java.lang.String |
getDataPathName()
Get the path of the data if the index data style is external or shadow. |
long |
getDataSize()
Get the size of the data items, if there is fixed size data. |
java.lang.String |
getDataType(ID typeID)
Get the type name of the things in the data stream. |
Description |
getDescription()
Get the description for an index. |
Timestamp |
getEndTime()
Get the end time of the index. |
Timestamp |
getFirstDataTime()
Get the data time for the first IndexItem in the Index. |
Timestamp |
getFirstTime()
Get the time the first IndexItem was put into the Index. |
ID |
getID()
Get an ID of an index. |
DataType |
getIndexDataType()
Get the index data type. |
java.lang.String |
getIndexPathName()
Get the indexPath of the index. |
IndexType |
getIndexType()
Get the index type. |
abstract IndexItem |
getItem(long n)
Get an Index Item from the Index. |
IndexItem |
getItem(Position p)
Get an Index Item from the Index. |
IndexItem |
getItem(Timestamp t)
Get an Index Item from the Index. |
IndexItem |
getItem(Timestamp t,
IndexTimestampSelector sel,
Lifetime lifetime)
Get an Index Item from the Index. |
int |
getItemSize()
Get the size of the items. |
Timestamp |
getLastAccessTime()
Get the last time an IndexItem was accessed from the index. |
Timestamp |
getLastDataTime()
Get the data time for the last IndexItem in the Index. |
Timestamp |
getLastTime()
Get the time the last IndexItem was put into the Index. |
long |
getLength()
Get the no of items in the index. |
boolean |
getLoadDataAutomatically()
Does the index load data automatically when doing a get item. |
java.lang.String |
getName()
Get the name of the index. |
Timestamp |
getStartTime()
Get the start time of the index. |
java.net.URI |
getURI()
Get the Index specification in the form of a URI. |
boolean |
hasAnnotations()
Does this index have annotations. |
boolean |
hasDataType(java.lang.String typeName)
Does this index have a typed name. |
boolean |
isActivated()
Is the Index activated. |
boolean |
isChanged()
Has the index changed in any way. |
boolean |
isClosed()
Is the Index closed. |
boolean |
isFixedSizeData()
Does the index have fixed size data. |
boolean |
isInTimeOrder()
Is the index still in time order. |
boolean |
isReadOnly()
Is the Index only available for read-only operations. |
boolean |
isTerminated()
Is the Index terminated. |
java.util.Iterator |
iterator()
Get an iterator over the IndexItems in the Index. |
TimestampMapping |
locate(Position p)
Try and determine the Timestamp associated with the speicifed Position. |
TimestampMapping |
locate(Position pos,
IndexTimestampSelector selector,
Lifetime lifetime)
Try and determine the Timestamp associated with the speicifed Position. |
TimestampMapping |
locate(Timestamp t)
Try and determine the position associated with the speicifed Timestamp. |
TimestampMapping |
locate(Timestamp t,
IndexTimestampSelector selector,
Lifetime lifetime)
Try and determine the position associated with the speicifed Timestamp. |
IndexView |
map(Function fn)
Map a function to all of the IndexItems, resulting in a new IncoreIndex. |
void |
removeAccessEventListener(IndexAccessEventListener l)
Remove a IndexAccessEventListener. |
void |
removeAddEventListener(IndexAddEventListener l)
Remove a IndexAddEventListener. |
void |
removePrimaryEventListener(IndexPrimaryEventListener l)
Remove a IndexPrimaryEventListener. |
IndexView |
select(AbsoluteTimestamp t,
IntervalSpecifier intervalSpecifier)
Select an Interval given a Timestamp and an IntervalSpecifier. |
IndexView |
select(AbsoluteTimestamp t,
IntervalSpecifier intervalSpecifier,
IndexTimestampSelector selector,
Overlap overlap,
Lifetime lifetime)
Select an Interval given a Timestamp and an IntervalSpecifier. |
IndexView |
select(Interval interval)
Select an Interval given an Interval object. |
IndexView |
select(Interval interval,
IndexTimestampSelector selector,
Overlap overlap,
Lifetime lifetime)
Select an Interval given an Interval object. |
boolean |
setAutoCommit(boolean commit)
Set auto commit to be true or false. |
CachePolicy |
setCachePolicy(CachePolicy policy)
Set a CachePolicy in order to manage the cache. |
protected Index |
setLastAccessTime()
Set the last time an IndexItem was accessed from the index. |
boolean |
setLoadDataAutomatically(boolean load)
Load data automatically when doing a get item. |
Index |
terminate()
Make the Index finalized. |
Index |
updateDescription(Description description)
Set the description. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.timeindexing.index.ExtendedIndex |
|---|
getFirstOffset, getLastFlushPosition, getLastFlushTime, getLastOffset |
| Methods inherited from interface com.timeindexing.index.Index |
|---|
activate, asView, close, isWriteLocked |
| Methods inherited from interface com.timeindexing.index.ExtendedIndexHeader |
|---|
addIndexURI, getIndexURI, hasIndexURI |
| Constructor Detail |
|---|
protected AbstractIndex()
| Method Detail |
|---|
public java.lang.String getName()
getName in interface IndexHeaderpublic ID getID()
getID in interface IndexHeaderpublic java.net.URI getURI()
getURI in interface IndexHeaderpublic Timestamp getStartTime()
getStartTime in interface IndexHeaderpublic Timestamp getEndTime()
getEndTime in interface IndexHeaderpublic Timestamp getFirstTime()
getFirstTime in interface IndexHeaderpublic Timestamp getLastTime()
getLastTime in interface IndexHeaderpublic Timestamp getFirstDataTime()
getFirstDataTime in interface IndexHeaderpublic Timestamp getLastDataTime()
getLastDataTime in interface IndexHeaderpublic int getItemSize()
getItemSize in interface ExtendedIndexHeadergetItemSize in interface Indexpublic boolean isFixedSizeData()
isFixedSizeData in interface IndexHeaderpublic long getDataSize()
getDataSize in interface ExtendedIndexHeadergetDataSize in interface IndexHeaderpublic java.lang.String getDataType(ID typeID)
getDataType in interface ExtendedIndexHeadergetDataType in interface Indexpublic boolean hasDataType(java.lang.String typeName)
hasDataType in interface ExtendedIndexHeaderhasDataType in interface Index
public boolean addDataType(ID typeID,
java.lang.String typeName)
addDataType in interface ExtendedIndexHeaderaddDataType in interface Indexpublic IndexType getIndexType()
getIndexType in interface ExtendedIndexgetIndexType in interface IndexHeaderpublic DataType getIndexDataType()
getIndexDataType in interface IndexHeaderpublic boolean isInTimeOrder()
isInTimeOrder in interface IndexHeaderpublic boolean hasAnnotations()
hasAnnotations in interface ExtendedIndexHeaderhasAnnotations in interface Indexpublic int getAnnotationStyle()
getAnnotationStyle in interface ExtendedIndexHeadergetAnnotationStyle in interface Indexpublic long getLength()
getLength in interface IndexHeader
public abstract IndexItem addItem(DataItem item)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
addItem in interface IndexIndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
public abstract IndexItem addItem(DataItem item,
Timestamp dataTime)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
addItem in interface IndexIndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
public abstract IndexItem addItem(DataItem item,
Timestamp dataTime,
long annotation)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
addItem in interface IndexIndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
protected IndexItem addItem(IndexItem item)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
item - the IndexItem to add
IndexTerminatedException - if the index has been terminated
and an attempt is made to add an Item
IndexActivationException - if the index has NOT been activated
and an attempt is made to add an Item
IndexClosedException
AddItemException
public abstract IndexItem addReference(IndexItem item,
Index other)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
addReference in interface IndexIndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
public abstract IndexItem addReference(IndexItem item,
Index other,
Timestamp dataTime)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
addReference in interface IndexIndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
public abstract IndexItem addReference(IndexItem item,
Index other,
Timestamp dataTime,
long annotation)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
addReference in interface IndexIndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
public abstract IndexItem getItem(long n)
throws GetItemException,
IndexClosedException
getItem in interface IndexGetItemException
IndexClosedException
public IndexItem getItem(Position p)
throws GetItemException,
IndexClosedException
getItem in interface IndexGetItemException
IndexClosedException
public IndexItem getItem(Timestamp t)
throws GetItemException,
IndexClosedException
getItem in interface IndexGetItemException
IndexClosedException
public IndexItem getItem(Timestamp t,
IndexTimestampSelector sel,
Lifetime lifetime)
throws GetItemException,
IndexClosedException
getItem in interface IndexGetItemException
IndexClosedExceptionpublic Timestamp getLastAccessTime()
getLastAccessTime in interface Indexprotected Index setLastAccessTime()
public java.lang.String getIndexPathName()
getIndexPathName in interface IndexHeaderpublic java.lang.String getDataPathName()
getDataPathName in interface IndexHeaderpublic Description getDescription()
getDescription in interface IndexHeaderpublic Index updateDescription(Description description)
updateDescription in interface Indexpublic boolean contains(Timestamp t)
contains in interface Index
public boolean contains(Timestamp t,
IndexTimestampSelector selector)
contains in interface Indexpublic TimestampMapping locate(Timestamp t)
locate in interface Index
public TimestampMapping locate(Timestamp t,
IndexTimestampSelector selector,
Lifetime lifetime)
locate in interface Indexpublic TimestampMapping locate(Position p)
locate in interface Index
public TimestampMapping locate(Position pos,
IndexTimestampSelector selector,
Lifetime lifetime)
locate in interface Index
protected TimestampMapping binarySearch(Timestamp t,
long start,
long end,
IndexTimestampSelector selector,
Lifetime lifetime,
int depth)
throws GetItemException,
IndexClosedException
GetItemException
IndexClosedExceptionpublic IndexView select(Interval interval)
select in interface Index
public IndexView select(AbsoluteTimestamp t,
IntervalSpecifier intervalSpecifier)
select in interface Index
public IndexView select(Interval interval,
IndexTimestampSelector selector,
Overlap overlap,
Lifetime lifetime)
select in interface Index
public IndexView select(AbsoluteTimestamp t,
IntervalSpecifier intervalSpecifier,
IndexTimestampSelector selector,
Overlap overlap,
Lifetime lifetime)
Index
select in interface Index
public IndexView filter(Function fn)
throws TimeIndexException
filter in interface IndexTimeIndexException
public IndexView map(Function fn)
throws TimeIndexException
map in interface IndexTimeIndexException
public DoubleLinkedList apply(Function fn)
throws TimeIndexException
apply in interface IndexTimeIndexExceptionpublic boolean isActivated()
isActivated in interface Indexpublic boolean isTerminated()
isTerminated in interface IndexHeaderpublic Index terminate()
terminate in interface Index
public boolean commit()
throws IndexCommitException
commit in interface IndexIndexCommitExceptionpublic boolean setAutoCommit(boolean commit)
setAutoCommit in interface Indexpublic boolean isClosed()
isClosed in interface Indexpublic boolean isChanged()
isChanged in interface Indexpublic boolean isReadOnly()
isReadOnly in interface IndexHeaderpublic java.util.Iterator iterator()
iterator in interface Indexpublic IndexCache getCache()
public CachePolicy getCachePolicy()
getCachePolicy in interface Indexpublic CachePolicy setCachePolicy(CachePolicy policy)
setCachePolicy in interface Indexpublic boolean getLoadDataAutomatically()
getLoadDataAutomatically in interface Indexpublic boolean setLoadDataAutomatically(boolean load)
setLoadDataAutomatically in interface Indexpublic IndexEventMulticaster eventMulticaster()
public void addPrimaryEventListener(IndexPrimaryEventListener l)
addPrimaryEventListener in interface IndexEventGeneratorpublic void removePrimaryEventListener(IndexPrimaryEventListener l)
removePrimaryEventListener in interface IndexEventGeneratorpublic void addAddEventListener(IndexAddEventListener l)
addAddEventListener in interface IndexEventGeneratorpublic void removeAddEventListener(IndexAddEventListener l)
removeAddEventListener in interface IndexEventGeneratorpublic void addAccessEventListener(IndexAccessEventListener l)
addAccessEventListener in interface IndexEventGeneratorpublic void removeAccessEventListener(IndexAccessEventListener l)
removeAccessEventListener in interface IndexEventGenerator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||