com.timeindexing.index
Class FileIndexItem

java.lang.Object
  extended bycom.timeindexing.index.IncoreIndexItem
      extended bycom.timeindexing.index.FileIndexItem
All Implemented Interfaces:
IndexItem, ManagedFileIndexItem, ManagedIndexItem, java.io.Serializable

public class FileIndexItem
extends IncoreIndexItem
implements IndexItem, ManagedFileIndexItem, java.io.Serializable

An implementatio of an IndexItem that is saved in a file. Every value is explicitly held.

See Also:
Serialized Form

Constructor Summary
FileIndexItem(Timestamp dataTS, Timestamp indexTS, DataAbstraction data, DataType type, ID id, ID annotationID)
          Construct a FileIndexItem from
FileIndexItem(Timestamp dataTS, Timestamp indexTS, DataAbstraction data, Size size, DataType type, ID id, ID annotationID)
          Construct a FileIndexItem from
FileIndexItem(Timestamp dataTS, Timestamp indexTS, DataItem dataitem, DataType type, ID id, ID annotationID)
          Construct a FileIndexItem from
 
Method Summary
 java.nio.ByteBuffer getData()
          A ByteBuffer of the Data being indexed.
 DataAbstraction getDataAbstraction()
          Get the DataAbstraction held by the IndexItem.
 Offset getDataOffset()
          Get the file offset for the data for this index item.
 Offset getIndexOffset()
          Get the file offset for the index for this index item.
 boolean hasData()
          Does this IndexItem actually hold the data.
 ManagedFileIndexItem setData(DataAbstraction data)
          Set the data to be a new DataAbstraction.
 ManagedFileIndexItem setDataOffset(Offset offset)
          Set the file offset for the data for this index item.
 ManagedFileIndexItem setIndexOffset(Offset offset)
          Set the file offset for the index for this index item.
 
Methods inherited from class com.timeindexing.index.IncoreIndexItem
follow, getAnnotations, getDataSize, getDataTimestamp, getDataType, getIndex, getIndexTimestamp, getItemID, getLastAccessTime, getPosition, isReference, setIndex, setLastAccessTime, setPosition
 
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.IndexItem
follow, getAnnotations, getDataSize, getDataTimestamp, getDataType, getIndex, getIndexTimestamp, getItemID, getLastAccessTime, getPosition, isReference
 
Methods inherited from interface com.timeindexing.index.ManagedIndexItem
setIndex, setLastAccessTime, setPosition
 

Constructor Detail

FileIndexItem

public FileIndexItem(Timestamp dataTS,
                     Timestamp indexTS,
                     DataItem dataitem,
                     DataType type,
                     ID id,
                     ID annotationID)
Construct a FileIndexItem from

Parameters:
dataTS - a data timestamp. The Data timestamp is the same as the Sender timestamp.
indexTS - an index timestamp. The Index timestamp is the same as the Receiver timestamp.
type - the type of the data
id - an index ID
annotationID - an ID for annotations

FileIndexItem

public FileIndexItem(Timestamp dataTS,
                     Timestamp indexTS,
                     DataAbstraction data,
                     DataType type,
                     ID id,
                     ID annotationID)
Construct a FileIndexItem from

Parameters:
dataTS - a data timestamp. The Data timestamp is the same as the Sender timestamp.
indexTS - an index timestamp. The Index timestamp is the same as the Receiver timestamp.
data - some data as a DataAbstraction
type - the type of the data
id - an index ID
annotationID - a ID for annotations

FileIndexItem

public FileIndexItem(Timestamp dataTS,
                     Timestamp indexTS,
                     DataAbstraction data,
                     Size size,
                     DataType type,
                     ID id,
                     ID annotationID)
Construct a FileIndexItem from

Parameters:
dataTS - a data timestamp. The Data timestamp is the same as the Sender timestamp.
indexTS - an index timestamp. The Index timestamp is the same as the Receiver timestamp.
data - some data as a DataAbstraction
size - the size of the DataAbstraction
type - the type of the data
id - an index ID
annotationID - a ID for annotations
Method Detail

getData

public java.nio.ByteBuffer getData()
A ByteBuffer of the Data being indexed.

Specified by:
getData in interface IndexItem
Overrides:
getData in class IncoreIndexItem
Returns:
an empty buffer, if this IndexItem doesn't have the data to hand

hasData

public boolean hasData()
Does this IndexItem actually hold the data.

Specified by:
hasData in interface ManagedFileIndexItem

getDataAbstraction

public DataAbstraction getDataAbstraction()
Get the DataAbstraction held by the IndexItem.

Specified by:
getDataAbstraction in interface ManagedIndexItem
Overrides:
getDataAbstraction in class IncoreIndexItem

setData

public ManagedFileIndexItem setData(DataAbstraction data)
Set the data to be a new DataAbstraction.

Specified by:
setData in interface ManagedFileIndexItem

getIndexOffset

public Offset getIndexOffset()
Get the file offset for the index for this index item.

Specified by:
getIndexOffset in interface ManagedFileIndexItem

setIndexOffset

public ManagedFileIndexItem setIndexOffset(Offset offset)
Set the file offset for the index for this index item.

Specified by:
setIndexOffset in interface ManagedFileIndexItem

getDataOffset

public Offset getDataOffset()
Get the file offset for the data for this index item.

Specified by:
getDataOffset in interface ManagedFileIndexItem

setDataOffset

public ManagedFileIndexItem setDataOffset(Offset offset)
Set the file offset for the data for this index item.

Specified by:
setDataOffset in interface ManagedFileIndexItem