org.wdssii.webindex.servlet
Class IndexRecordList

java.lang.Object
  extended by org.wdssii.webindex.servlet.IndexRecordList

public class IndexRecordList
extends Object

Transfer object containing a number of IndexRecordBeans corresponding to a source.

Version:
$Id: IndexRecordList.java,v 1.4 2007/10/29 20:46:15 lakshman Exp $
Author:
Lakshman

Field Summary
private  long lastNumber
           
private  IndexRecordBean[] records
           
static int RETURN_ALL_RECORDS
           
static int RETURN_LATEST_ONLY
           
private  String source
           
 
Constructor Summary
private IndexRecordList(String source, IndexRecordBean[] indexRecords, long lastNumber)
          the IndexRecords should already be sorted.
 
Method Summary
 long getLastNumber()
          returns -ve if no IndexRecords are here.
 IndexRecordBean[] getRecords()
          The list can be empty, but it won't be null.
private  IndexRecordBean[] getRecordsAfterIndex(int start)
           
 String getSource()
          Name of source
 IndexRecordList newInstance(long lastRead)
          Returns a cloned copy of this TO, pruned to the number of the last IndexRecord specified.
static IndexRecordList newInstance(String source)
          create empty TO
 void pruneToMaxSize(long maxSize)
           
 void setRecords(Collection<IndexRecordBean> c)
           
private  void updateLast()
          set state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private String source

records

private IndexRecordBean[] records

lastNumber

private long lastNumber

RETURN_ALL_RECORDS

public static final int RETURN_ALL_RECORDS
See Also:
Constant Field Values

RETURN_LATEST_ONLY

public static final int RETURN_LATEST_ONLY
See Also:
Constant Field Values
Constructor Detail

IndexRecordList

private IndexRecordList(String source,
                        IndexRecordBean[] indexRecords,
                        long lastNumber)
the IndexRecords should already be sorted.

Method Detail

getSource

public String getSource()
Name of source


getRecords

public IndexRecordBean[] getRecords()
The list can be empty, but it won't be null.


getLastNumber

public long getLastNumber()
returns -ve if no IndexRecords are here.


updateLast

private void updateLast()
set state


newInstance

public IndexRecordList newInstance(long lastRead)
Returns a cloned copy of this TO, pruned to the number of the last IndexRecord specified.


getRecordsAfterIndex

private IndexRecordBean[] getRecordsAfterIndex(int start)

newInstance

public static IndexRecordList newInstance(String source)
create empty TO


setRecords

public void setRecords(Collection<IndexRecordBean> c)

pruneToMaxSize

public void pruneToMaxSize(long maxSize)