|
||||||||||
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 IndexHeader
public ID getID()
getID
in interface IndexHeader
public java.net.URI getURI()
getURI
in interface IndexHeader
public Timestamp getStartTime()
getStartTime
in interface IndexHeader
public Timestamp getEndTime()
getEndTime
in interface IndexHeader
public Timestamp getFirstTime()
getFirstTime
in interface IndexHeader
public Timestamp getLastTime()
getLastTime
in interface IndexHeader
public Timestamp getFirstDataTime()
getFirstDataTime
in interface IndexHeader
public Timestamp getLastDataTime()
getLastDataTime
in interface IndexHeader
public int getItemSize()
getItemSize
in interface Index
public boolean isFixedSizeData()
isFixedSizeData
in interface IndexHeader
public long getDataSize()
getDataSize
in interface IndexHeader
public java.lang.String getDataType(ID typeID)
getDataType
in interface Index
public boolean hasDataType(java.lang.String typeName)
hasDataType
in interface Index
public boolean addDataType(ID typeID, java.lang.String typeName)
addDataType
in interface Index
public IndexType getIndexType()
getIndexType
in interface ExtendedIndex
public DataType getIndexDataType()
getIndexDataType
in interface IndexHeader
public boolean isInTimeOrder()
isInTimeOrder
in interface IndexHeader
public boolean hasAnnotations()
hasAnnotations
in interface Index
public int getAnnotationStyle()
getAnnotationStyle
in interface Index
public long getLength()
getLength
in interface IndexHeader
public abstract long addItem(DataItem item) throws IndexTerminatedException, IndexClosedException, IndexActivationException, AddItemException
addItem
in interface Index
IndexTerminatedException
IndexClosedException
IndexActivationException
AddItemException
public abstract long addItem(DataItem item, Timestamp dataTime) throws IndexTerminatedException, IndexClosedException, IndexActivationException, AddItemException
addItem
in interface Index
IndexTerminatedException
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 Index
GetItemException
public IndexItem getItem(Position p) throws GetItemException
getItem
in interface Index
GetItemException
public IndexItem getItem(Timestamp t, IndexTimestampSelector sel, Lifetime lifetime) throws GetItemException
getItem
in interface Index
GetItemException
public Timestamp getLastAccessTime()
getLastAccessTime
in interface Index
protected Index setLastAccessTime()
public java.lang.String getIndexPathName()
getIndexPathName
in interface IndexHeader
public java.lang.String getDataPathName()
getDataPathName
in interface IndexHeader
public Description getDescription()
getDescription
in interface IndexHeader
public 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
GetItemException
public boolean isActivated()
isActivated
in interface Index
public boolean isTerminated()
isTerminated
in interface IndexHeader
public Index terminate()
terminate
in interface Index
public boolean commit() throws IndexCommitException
commit
in interface Index
IndexCommitException
public boolean setAutoCommit(boolean commit)
setAutoCommit
in interface Index
public boolean isClosed()
isClosed
in interface Index
public boolean isChanged()
isChanged
in interface Index
public boolean isReadOnly()
isReadOnly
in interface IndexHeader
public java.util.Iterator iterator()
iterator
in interface Index
public boolean setCachePolicy(CachePolicy policy)
setCachePolicy
in interface Index
public IndexEventMulticaster eventMulticaster()
public void addPrimaryEventListener(IndexPrimaryEventListener l)
addPrimaryEventListener
in interface IndexEventGenerator
public void removePrimaryEventListener(IndexPrimaryEventListener l)
removePrimaryEventListener
in interface IndexEventGenerator
public void addAddEventListener(IndexAddEventListener l)
addAddEventListener
in interface IndexEventGenerator
public void removeAddEventListener(IndexAddEventListener l)
removeAddEventListener
in interface IndexEventGenerator
public void addAccessEventListener(IndexAccessEventListener l)
addAccessEventListener
in interface IndexEventGenerator
public void removeAccessEventListener(IndexAccessEventListener l)
removeAccessEventListener
in interface IndexEventGenerator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |