Class DatabaseContainer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.tools.wekainvestigator.data.AbstractDataContainer
-
- adams.gui.tools.wekainvestigator.data.DatabaseContainer
-
- All Implemented Interfaces:
CleanUpHandler,LoggingSupporter,SizeOfHandler,UndoHandler,UndoHandlerWithQuickAccess,UndoListener,DataContainer,Serializable,Comparable<DataContainer>,EventListener
public class DatabaseContainer extends AbstractDataContainer
Dataset loaded from database.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_Passwordthe password.protected Stringm_Querythe query used to load the data.protected Stringm_URLthe database URL.protected Stringm_Userthe user.-
Fields inherited from class adams.gui.tools.wekainvestigator.data.AbstractDataContainer
m_Data, m_ID, m_IDCounter, m_LastUpdated, m_Modified, m_Undo
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description DatabaseContainer(String url, String user, String pw, String query)Loads the data using the specified url/query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyUndoData(Serializable[] data)Restores the data from the undo point.booleancanReload()Whether it is possible to reload this item.voidcleanUp()Cleans up data structures, frees up memory.protected StringdoReload()Reloads the data.StringgetSource()Returns the source of the data item.protected Serializable[]getUndoData()Returns the data to store in the undo.-
Methods inherited from class adams.gui.tools.wekainvestigator.data.AbstractDataContainer
addUndoPoint, compareTo, equals, getData, getID, getUndo, handleException, isModified, isUndoSupported, lastUpdated, nextID, redo, reload, setData, setModified, setUndo, toString, undo, undoOccurred
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
getSource
public String getSource()
Returns the source of the data item.- Returns:
- the source
-
canReload
public boolean canReload()
Whether it is possible to reload this item.- Returns:
- true if reloadable
-
doReload
protected String doReload()
Reloads the data.- Specified by:
doReloadin classAbstractDataContainer- Returns:
- null if successfully reloaded, otherwise error message
-
getUndoData
protected Serializable[] getUndoData()
Returns the data to store in the undo.- Overrides:
getUndoDatain classAbstractDataContainer- Returns:
- the undo point
-
applyUndoData
protected void applyUndoData(Serializable[] data)
Restores the data from the undo point.- Overrides:
applyUndoDatain classAbstractDataContainer- Parameters:
data- the undo point
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceCleanUpHandler- Overrides:
cleanUpin classAbstractDataContainer
-
-