|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.indiana.iucbrf.casebase.AbstractCaseBase
edu.indiana.iucbrf.casebase.AbstractKeyableCaseBase
edu.indiana.iucbrf.casebase.FileCaseBase
public class FileCaseBase
A FileCaseBase stores cases in a B-tree-backed file. The indices of the cases are stored in memory for fast similarity comparisons, and the full cases are stored in a iglu.util.FileBTree. To fully write the case base to a file (so the system may be shut down), serialize the FileCaseBase object. When the system is started up again, deserialize it. Note that edu.indiana.util.ObjectFileIO can be of great help in object serialization.
Field Summary | |
---|---|
protected java.lang.String |
baseFilename
|
protected iglu.util.FileBTree |
fullCB
|
protected CaseBase |
indexCB
|
protected static int |
LONG_KEY_SIZE
|
protected int |
t
|
Fields inherited from class edu.indiana.iucbrf.casebase.AbstractKeyableCaseBase |
---|
markerList |
Fields inherited from class edu.indiana.iucbrf.casebase.AbstractCaseBase |
---|
caseClass, debugMode, DEFAULT_INITIAL_CAPACITY, domain, listeners, prototype |
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable |
---|
TITLE_FONT |
Constructor Summary | |
---|---|
protected |
FileCaseBase()
|
|
FileCaseBase(CaseBase indexCB,
java.lang.String baseFilename,
Domain domain)
Creates a new instance of FileCaseBase |
|
FileCaseBase(CaseBase indexCB,
java.lang.String baseFilename,
Domain domain,
java.lang.Class case_class)
|
|
FileCaseBase(CaseBase indexCB,
java.lang.String baseFilename,
Domain domain,
int t)
|
|
FileCaseBase(CaseBase indexCB,
java.lang.String baseFilename,
Domain domain,
int t,
java.lang.Class case_class)
|
|
FileCaseBase(java.lang.String baseFilename,
Domain domain,
java.lang.Class case_class)
|
Method Summary | |
---|---|
void |
addCaseWithKey(Case caseToAdd)
Implement this method to add a case to the case base, assuming that class and event issues are already handled by addCase(). |
void |
close()
Perform any maintenance needed during finalization of this CaseBase, such closing of open files. |
void |
ensureCapacity(int minCapacity)
Prepare the case base to be able to hold at least minCapacity cases. |
Case |
getCase(long key)
Get the case at a given key. |
int |
getCaseCount()
Get the size of the case base. |
protected void |
initializeCB(int initialCapacity)
|
java.util.Iterator |
iterator()
Create an iterator on the case base. |
boolean |
removeCase(long key)
Remove the case with the given key. |
protected boolean |
removeCaseImpl(Case toRemove)
Implement this method to remove a case from the case base, assuming that class and event issues are already handled by removeCase(). |
void |
setBaseFileName(java.lang.String baseFilename)
Set the base filename that will be used for saving this case base. |
java.lang.String |
toVerboseString()
Can be overridden to provide more details than toString(). |
Methods inherited from class edu.indiana.iucbrf.casebase.AbstractKeyableCaseBase |
---|
addCaseImpl, getMarkerKeys, getNextCaseKey |
Methods inherited from class edu.indiana.iucbrf.casebase.AbstractCaseBase |
---|
addCase, addCaseBaseListener, addCases, addCases, addCases, buildCaseJList, checkCaseType, classMemberIterator, clearAllEstimates, fireCaseAdded, fireCaseClassChanged, fireCaseRemoved, fireCaseReplaced, fireCasesCleared, getCaseClass, getCasesMatching, getDomain, getPrototype, isEmpty, removeCase, removeCaseBaseListener, setCaseClass, setDebugMode, setDomain, toString, toSwing, toSwing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.indiana.iucbrf.casebase.CaseBase |
---|
addCase, addCaseBaseListener, addCases, addCases, addCases, clearAllEstimates, getCaseClass, getCasesMatching, getDomain, isEmpty, removeCase, removeCaseBaseListener, setCaseClass, setDomain, toString |
Methods inherited from interface edu.indiana.iucbrf.util.SwingRepresentableWithDomain |
---|
toSwing |
Methods inherited from interface edu.indiana.util.swing.SwingRepresentable |
---|
toSwing |
Field Detail |
---|
protected static final int LONG_KEY_SIZE
protected int t
protected CaseBase indexCB
protected iglu.util.FileBTree fullCB
protected java.lang.String baseFilename
Constructor Detail |
---|
protected FileCaseBase()
public FileCaseBase(java.lang.String baseFilename, Domain domain, java.lang.Class case_class)
public FileCaseBase(CaseBase indexCB, java.lang.String baseFilename, Domain domain)
public FileCaseBase(CaseBase indexCB, java.lang.String baseFilename, Domain domain, java.lang.Class case_class)
public FileCaseBase(CaseBase indexCB, java.lang.String baseFilename, Domain domain, int t)
public FileCaseBase(CaseBase indexCB, java.lang.String baseFilename, Domain domain, int t, java.lang.Class case_class)
Method Detail |
---|
protected void initializeCB(int initialCapacity)
initializeCB
in class AbstractCaseBase
public java.util.Iterator iterator()
iterator
in interface CaseBase
iterator
in class AbstractCaseBase
public void addCaseWithKey(Case caseToAdd)
public Case getCase(long key)
key
- The key of the case to be retrieved.
public boolean removeCase(long key)
KeyableCaseBase
key
- The key of the case to be removed.
protected boolean removeCaseImpl(Case toRemove)
removeCaseImpl
in class AbstractKeyableCaseBase
c
- The case to be removed.public void setBaseFileName(java.lang.String baseFilename)
setBaseFileName
in interface CaseBase
setBaseFileName
in class AbstractCaseBase
public java.lang.String toVerboseString()
AbstractCaseBase
toVerboseString
in interface CaseBase
toVerboseString
in class AbstractCaseBase
public void ensureCapacity(int minCapacity)
ensureCapacity
in interface CaseBase
ensureCapacity
in class AbstractCaseBase
public int getCaseCount()
public void close()
close
in interface CaseBase
close
in class AbstractCaseBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |