|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.indiana.iucbrf.feature.featurespec.AbstractFeatureSpecCollection edu.indiana.iucbrf.feature.featurespec.FeatureSpecRDB
public class FeatureSpecRDB
This class can be used to store a set of feature specs into a relational database.
Field Summary | |
---|---|
protected FeatureSpecMap |
cacheMap
|
protected java.sql.Connection |
con
|
protected Domain |
domain
|
protected FeatureSpecRDBInfo |
featureSpecRDBInfo
|
protected java.util.Iterator |
iterator
|
protected java.sql.Statement |
stmt
|
Fields inherited from class edu.indiana.iucbrf.feature.featurespec.AbstractFeatureSpecCollection |
---|
title |
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable |
---|
TITLE_FONT |
Constructor Summary | |
---|---|
protected |
FeatureSpecRDB()
For serialization - do not call explicitly |
|
FeatureSpecRDB(Domain domain,
FeatureSpecRDBInfo featureSpecRDBInfo)
Constructor |
|
FeatureSpecRDB(Domain domain,
FeatureSpecRDBInfo featureSpecRDBInfo,
FeatureKey[] featureKeys,
java.lang.String[] featureDescriptions,
java.lang.String[] featureTypeNames)
Constructor |
Method Summary | |
---|---|
void |
addFeatureSpec(FeatureSpec featureSpec)
Adds a featurespec to a database |
void |
doThreadedOperation()
|
protected void |
finalize()
Used to close the connections made by an instance of a FeatureSpecRDB is garbage collected. |
FeatureSpecMap |
getCacheMap()
|
FeatureSpec |
getFeatureSpec(FeatureKey key)
Reads the featurespec given by the featurekey from the database and returns and constructs a FeatureSpec out of it |
int |
getFeatureSpecCount()
returns the number of featurespec currently stored in the database |
FeatureSpecRDBInfo |
getFeatureSpecRDBInfo()
Method getFeatureSpecRDBInfo |
protected void |
handleCacheGetFeatureSpecMiss(FeatureSpec featureSpec)
Caches a featurespec that has been read from a database |
void |
loadAllIntoCacheInSeparateThread()
Should be called by the user if the specs should be loaded in all at once into the cache, rather than simply on demand. |
java.util.Iterator |
orderedAllEntryIterator()
Method orderedAllEntryIterator |
FeatureKey[] |
orderedAllKeyArray()
Method orderedAllKeyArray |
java.util.Iterator |
orderedAllKeyIterator()
returns an iterator on all keys: printable or unprintable, sub feature or full feature |
java.util.Iterator |
orderedAllSpecIterator()
Method orderedAllSpecIterator |
protected void |
readFeatureSpecRDBIntoCache()
Ordinarily, feature specs are cached "on demand" by this class. |
FeatureSpec |
readSingleFeatureSpecFromDB(FeatureKey key)
|
void |
removeFeatureSpec(FeatureKey key)
removes a featurespec from the database |
protected void |
setAllConstructorArgsIntoCache()
Reads the classnames from the class table, to fill in this detail of the specs in the cacheMap. |
protected void |
setAllExtraDataIntoCache()
Reads the key and value for all extra data, to fill in this detail of the specs in the cacheMap. |
protected void |
setAllFeatureSpecShellsIntoCache()
Reads name, description, classType, featureKey, format, isPrintable, isSubFeatureOf, and Extradata from primary feature spec table for this collection. |
void |
setDoneWithThreadedOperation(boolean doneWithThreadedOperation)
|
void |
setFormat(FeatureKey featureKey,
FeatureValueFormat format)
|
protected void |
waitForCacheLoad()
|
Methods inherited from class edu.indiana.iucbrf.feature.featurespec.AbstractFeatureSpecCollection |
---|
equals, fromXML, getTitle, isFullyCompliant, isPartiallyCompliant, putExtraData, removeFeatureSpec, setDescription, setIsPrintable, setIsSubFeature, setName, setStandardConstructor, setStandardConstructor, setStandardConstructor, setTitle, setType, toString, toSwing, toXML |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Iterator iterator
protected java.sql.Statement stmt
protected java.sql.Connection con
protected Domain domain
protected FeatureSpecRDBInfo featureSpecRDBInfo
protected FeatureSpecMap cacheMap
Constructor Detail |
---|
protected FeatureSpecRDB()
public FeatureSpecRDB(Domain domain, FeatureSpecRDBInfo featureSpecRDBInfo)
domain
- a DomainfeatureSpecRDBInfo
- a FeatureSpecRDBInfopublic FeatureSpecRDB(Domain domain, FeatureSpecRDBInfo featureSpecRDBInfo, FeatureKey[] featureKeys, java.lang.String[] featureDescriptions, java.lang.String[] featureTypeNames)
domain
- a DomainfeatureSpecRDBInfo
- a FeatureSpecRDBInfofeatureKeys
- a FeatureKey[]featureDescriptions
- a String[]featureTypeNames
- a String[]Method Detail |
---|
protected void finalize()
finalize
in class java.lang.Object
public void loadAllIntoCacheInSeparateThread()
protected void waitForCacheLoad()
public void setDoneWithThreadedOperation(boolean doneWithThreadedOperation)
setDoneWithThreadedOperation
in interface Multithreaded
public void doThreadedOperation()
doThreadedOperation
in interface Multithreaded
protected void readFeatureSpecRDBIntoCache()
protected void setAllFeatureSpecShellsIntoCache()
protected void setAllConstructorArgsIntoCache()
protected void setAllExtraDataIntoCache()
public FeatureSpecRDBInfo getFeatureSpecRDBInfo()
public int getFeatureSpecCount()
getFeatureSpecCount
in interface FeatureSpecCollection
public FeatureSpec getFeatureSpec(FeatureKey key)
getFeatureSpec
in interface FeatureSpecCollection
key
- a FeatureKey
public FeatureSpec readSingleFeatureSpecFromDB(FeatureKey key)
public FeatureSpecMap getCacheMap()
protected void handleCacheGetFeatureSpecMiss(FeatureSpec featureSpec)
featureSpec
- a FeatureSpecpublic void addFeatureSpec(FeatureSpec featureSpec)
addFeatureSpec
in interface FeatureSpecCollection
featureSpec
- a FeatureSpecpublic void removeFeatureSpec(FeatureKey key)
removeFeatureSpec
in interface FeatureSpecCollection
featureSpec
- a FeatureSpecpublic void setFormat(FeatureKey featureKey, FeatureValueFormat format)
setFormat
in interface FeatureSpecCollection
setFormat
in class AbstractFeatureSpecCollection
public java.util.Iterator orderedAllKeyIterator()
orderedAllKeyIterator
in interface FeatureSpecCollection
public java.util.Iterator orderedAllEntryIterator()
orderedAllEntryIterator
in interface FeatureSpecCollection
public java.util.Iterator orderedAllSpecIterator()
orderedAllSpecIterator
in interface FeatureSpecCollection
public FeatureKey[] orderedAllKeyArray()
orderedAllKeyArray
in interface FeatureSpecCollection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |