|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.timeindexing.index.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 long |
addItem(DataItem item)
Add a Data Item to the Index. |
abstract long |
addItem(DataItem item,
Timestamp dataTime)
Add a Data Item to the Index with a speicifed Data Timestamp |
protected long |
addItem(IndexItem item)
Add an Index Item to the Index. |
void |
addPrimaryEventListener(IndexPrimaryEventListener l)
Add a IndexPrimaryEventListener. |
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,
IndexTimestampSelector selector)
Does a timestamp fall within the bounds of the Index. |
IndexEventMulticaster |
eventMulticaster()
Get the event listener. |
int |
getAnnotationStyle()
Get the annotation style. |
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,
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. |
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 pos,
IndexTimestampSelector selector,
Lifetime lifetime)
Try and determine the Timestamp associated with the speicifed Position. |
TimestampMapping |
locate(Timestamp t,
IndexTimestampSelector selector,
Lifetime lifetime)
Try and determine the position associated with the speicifed Timestamp. |
void |
removeAccessEventListener(IndexAccessEventListener l)
Remove a IndexAccessEventListener. |
void |
removeAddEventListener(IndexAddEventListener l)
Remove a IndexAddEventListener. |
void |
removePrimaryEventListener(IndexPrimaryEventListener l)
Remove a IndexPrimaryEventListener. |
boolean |
setAutoCommit(boolean commit)
Set auto commit to be true or false. |
boolean |
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. |
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, addReference, addReference, 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 Indexpublic boolean isFixedSizeData()
isFixedSizeData in interface IndexHeaderpublic long getDataSize()
getDataSize in interface IndexHeaderpublic java.lang.String getDataType(ID typeID)
getDataType in interface Indexpublic boolean hasDataType(java.lang.String typeName)
hasDataType in interface Index
public boolean addDataType(ID typeID,
java.lang.String typeName)
addDataType in interface Indexpublic IndexType getIndexType()
getIndexType in interface ExtendedIndexpublic DataType getIndexDataType()
getIndexDataType in interface IndexHeaderpublic boolean isInTimeOrder()
isInTimeOrder in interface IndexHeaderpublic boolean hasAnnotations()
hasAnnotations in interface Indexpublic int getAnnotationStyle()
getAnnotationStyle in interface Indexpublic long getLength()
getLength in interface IndexHeader
public abstract long addItem(DataItem item)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
addItem in interface IndexIndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
public abstract long addItem(DataItem item,
Timestamp dataTime)
throws IndexTerminatedException,
IndexClosedException,
IndexActivationException,
AddItemException
addItem in interface IndexIndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
protected long 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 getItem(long n)
throws GetItemException
getItem in interface IndexGetItemException
public IndexItem getItem(Position p)
throws GetItemException
getItem in interface IndexGetItemException
public IndexItem getItem(Timestamp t,
IndexTimestampSelector sel,
Lifetime lifetime)
throws GetItemException
getItem in interface IndexGetItemExceptionpublic 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 Index
public boolean contains(Timestamp t,
IndexTimestampSelector selector)
contains in interface Index
public TimestampMapping locate(Timestamp t,
IndexTimestampSelector selector,
Lifetime lifetime)
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
GetItemExceptionpublic 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 boolean setCachePolicy(CachePolicy policy)
setCachePolicy 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 | |||||||||