|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.indiana.iucbrf.casebase.AbstractCaseBase edu.indiana.iucbrf.casebase.AbstractKeyableCaseBase edu.indiana.iucbrf.casebase.RDBCaseBase
public class RDBCaseBase
A RDBCaseBase stores a list of cases in a relational database and uses SQL queries to read them back into memory.
Field Summary | |
---|---|
protected java.sql.Connection |
con
|
protected Domain |
domain
|
protected java.util.Iterator |
iterator
|
protected RDBCaseBaseInfo |
rdbCaseBaseInfo
|
protected java.sql.Statement |
stmt
|
Fields inherited from class edu.indiana.iucbrf.casebase.AbstractKeyableCaseBase |
---|
markerList |
Fields inherited from class edu.indiana.iucbrf.casebase.AbstractCaseBase |
---|
caseClass, debugMode, DEFAULT_INITIAL_CAPACITY, listeners, prototype |
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable |
---|
TITLE_FONT |
Constructor Summary | |
---|---|
RDBCaseBase(Domain domain,
RDBCaseBaseInfo rdbCaseBaseInfo)
Constructor |
|
RDBCaseBase(Domain domain,
RDBCaseBaseInfo rdbCaseBaseInfo,
CaseGenerator caseGenerator,
int numToGenerate)
Constructor |
Method Summary | |
---|---|
void |
addCaseWithKey(Case acase)
Adds the case with the given key. |
protected void |
addInactiveContextsToTable(java.util.HashSet inactiveContexts,
int inactiveContextsKey)
Adds the inactive contexts to the inactiveContextable |
protected void |
addProblemToTable(Problem p,
int problemKey)
Adds the problem features to the problemtable |
protected void |
addSolutionToTable(Solution s,
int solutionKey)
Adds the solution features to the solutiontable |
void |
close()
This method closes the connection to the database in which the casebase is stored |
void |
ensureCapacity(int minimumCapacity)
Method ensureCapacity |
protected void |
finalize()
Used to close the casebase when a RDBCaseBase object is garbage collected. |
protected Case |
getBasicCaseInfoGivenKey(int key)
|
Case |
getCase(long key)
Get the case with the given key. |
int |
getCaseCount()
Gets the number of cases in this case base |
protected java.util.HashSet |
getInactiveContextsGivenKey(int inactiveContextsKey)
Reads the inactive contexts for a given solution key and construtcs a HashSet out of it. |
protected Featured[] |
getProblemAndSolutionGivenKey(int key)
|
protected void |
initializeCB(Domain domain,
RDBCaseBaseInfo rdbCaseBaseInfo)
Method initializeCB |
protected void |
initializeCB(int minCapacity)
Method initializeCB |
java.util.Iterator |
iterator()
Create an iterator on the case base. |
protected Case |
makeCaseShellFromResultSet(java.sql.ResultSet caseBaseTableRS)
|
boolean |
removeCase(long key)
Remove the case with the given key. |
protected boolean |
removeCase(long key,
boolean fireCaseRemoved)
Remove the case with the given key. |
protected boolean |
removeCaseImpl(Case c)
Completes the task of removing a case, begun by removeCase(). |
java.lang.String |
toString()
Convert this case base into a String representation. |
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, setBaseFileName, setCaseClass, setDebugMode, setDomain, toSwing, toSwing, toVerboseString |
Methods inherited from class java.lang.Object |
---|
clone, equals, 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, setBaseFileName, setCaseClass, setDomain, toVerboseString |
Methods inherited from interface edu.indiana.iucbrf.util.SwingRepresentableWithDomain |
---|
toSwing |
Methods inherited from interface edu.indiana.util.swing.SwingRepresentable |
---|
toSwing |
Field Detail |
---|
protected java.sql.Statement stmt
protected java.sql.Connection con
protected java.util.Iterator iterator
protected Domain domain
protected RDBCaseBaseInfo rdbCaseBaseInfo
Constructor Detail |
---|
public RDBCaseBase(Domain domain, RDBCaseBaseInfo rdbCaseBaseInfo)
domain
- a DomainrdbCaseBaseInfo
- a RDBCaseBaseInfopublic RDBCaseBase(Domain domain, RDBCaseBaseInfo rdbCaseBaseInfo, CaseGenerator caseGenerator, int numToGenerate)
domain
- a DomainrdbCaseBaseInfo
- a RDBCaseBaseInfocaseGenerator
- a CaseGeneratornumToGenerate
- an intMethod Detail |
---|
protected void finalize()
finalize
in class java.lang.Object
public void close()
close
in interface CaseBase
close
in class AbstractCaseBase
public void addCaseWithKey(Case acase)
acase
- a Casepublic void ensureCapacity(int minimumCapacity)
ensureCapacity
in interface CaseBase
ensureCapacity
in class AbstractCaseBase
minimumCapacity
- an intpublic Case getCase(long key)
key
- The key of the case to be retrieved.
protected Case getBasicCaseInfoGivenKey(int key)
protected Case makeCaseShellFromResultSet(java.sql.ResultSet caseBaseTableRS)
protected Featured[] getProblemAndSolutionGivenKey(int key)
protected java.util.HashSet getInactiveContextsGivenKey(int inactiveContextsKey)
inactiveContextsKey
- an int
protected void addProblemToTable(Problem p, int problemKey)
p
- a ProblemproblemKey
- an intprotected void addSolutionToTable(Solution s, int solutionKey)
s
- a SolutionsolutionKey
- an intprotected void addInactiveContextsToTable(java.util.HashSet inactiveContexts, int inactiveContextsKey)
inactiveContexts
- a HashSetinactiveContextsKey
- an intpublic int getCaseCount()
public java.lang.String toString()
toString
in interface CaseBase
toString
in class AbstractCaseBase
protected boolean removeCaseImpl(Case c)
removeCaseImpl
in class AbstractKeyableCaseBase
public boolean removeCase(long key)
KeyableCaseBase
key
- The key of the case to be removed.
protected boolean removeCase(long key, boolean fireCaseRemoved)
key
- The key of the case to be removed.
public java.util.Iterator iterator()
iterator
in interface CaseBase
iterator
in class AbstractCaseBase
protected void initializeCB(Domain domain, RDBCaseBaseInfo rdbCaseBaseInfo)
initialCapacity
- an intprotected void initializeCB(int minCapacity)
initializeCB
in class AbstractCaseBase
minCapacity
- an int
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |