Package adams.data.container
Class AbstractSimpleContainer<T>
- java.lang.Object
-
- adams.data.container.AbstractSimpleContainer<T>
-
- Type Parameters:
T- the type of content to handle
- All Implemented Interfaces:
CloneHandler<AbstractSimpleContainer<T>>,UniqueIDHandler,MutableNotesHandler,NotesHandler,MutableReportHandler<Report>,ReportHandler<Report>,Serializable
- Direct Known Subclasses:
AbstractImageContainer,BlobContainer,ObjectContainer,TextContainer,WekaInstanceContainer
public abstract class AbstractSimpleContainer<T> extends Object implements Serializable, CloneHandler<AbstractSimpleContainer<T>>, MutableNotesHandler, MutableReportHandler<Report>, UniqueIDHandler
Ancestor for simple containers for objects that also offers notes and a report for storing meta-data.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSimpleContainer()Initializes the container.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TcloneContent()Returns a clone of the content.AbstractSimpleContainer<T>getClone()Returns a clone of the object.TgetContent()Returns the store content.AbstractSimpleContainer<T>getHeader()Returns a new container with the report and notes copied, but without the content.NotesgetNotes()Returns the currently stored notes.ReportgetReport()Returns the current report.longgetUniqueID()Returns the unique ID.booleanhasReport()Checks whether a report is present.protected voidinitialize()Initializes the members.voidsetContent(T value)Sets the content to use.voidsetNotes(Notes value)Sets the notes to use.voidsetReport(Report value)Sets the report to use.StringtoString()Returns a string representation of the container.
-
-
-
Field Detail
-
FIELD_FILENAME
public static final String FIELD_FILENAME
the field for the filename.- See Also:
- Constant Field Values
-
m_Content
protected T m_Content
the stored content.
-
m_Report
protected Report m_Report
the report.
-
m_Notes
protected Notes m_Notes
the notes.
-
m_UUID
protected long m_UUID
the unique ID.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.
-
getUniqueID
public long getUniqueID()
Returns the unique ID.- Specified by:
getUniqueIDin interfaceUniqueIDHandler- Returns:
- the ID
-
cloneContent
protected abstract T cloneContent()
Returns a clone of the content.- Returns:
- the clone
-
getClone
public AbstractSimpleContainer<T> getClone()
Returns a clone of the object.- Specified by:
getClonein interfaceCloneHandler<T>- Returns:
- the clone
- See Also:
getHeader()
-
getHeader
public AbstractSimpleContainer<T> getHeader()
Returns a new container with the report and notes copied, but without the content.- Returns:
- the container without the content
- See Also:
getClone()
-
setContent
public void setContent(T value)
Sets the content to use.- Parameters:
value- the content
-
getContent
public T getContent()
Returns the store content.- Returns:
- the content
-
hasReport
public boolean hasReport()
Checks whether a report is present.- Specified by:
hasReportin interfaceReportHandler<T>- Returns:
- true if a report is present
-
setReport
public void setReport(Report value)
Sets the report to use.- Specified by:
setReportin interfaceMutableReportHandler<T>- Parameters:
value- the report
-
getReport
public Report getReport()
Returns the current report.- Specified by:
getReportin interfaceReportHandler<T>- Returns:
- the report
-
setNotes
public void setNotes(Notes value)
Sets the notes to use.- Parameters:
value- the new notes
-
getNotes
public Notes getNotes()
Returns the currently stored notes.- Specified by:
getNotesin interfaceMutableNotesHandler- Specified by:
getNotesin interfaceNotesHandler- Returns:
- the current notes
-
-