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 protected
AbstractSimpleContainer()
Initializes the container.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
cloneContent()
Returns a clone of the content.AbstractSimpleContainer<T>
getClone()
Returns a clone of the object.T
getContent()
Returns the store content.AbstractSimpleContainer<T>
getHeader()
Returns a new container with the report and notes copied, but without the content.Notes
getNotes()
Returns the currently stored notes.Report
getReport()
Returns the current report.long
getUniqueID()
Returns the unique ID.boolean
hasReport()
Checks whether a report is present.protected void
initialize()
Initializes the members.void
setContent(T value)
Sets the content to use.void
setNotes(Notes value)
Sets the notes to use.void
setReport(Report value)
Sets the report to use.String
toString()
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:
getUniqueID
in 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:
getClone
in 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:
hasReport
in interfaceReportHandler<T>
- Returns:
- true if a report is present
-
setReport
public void setReport(Report value)
Sets the report to use.- Specified by:
setReport
in interfaceMutableReportHandler<T>
- Parameters:
value
- the report
-
getReport
public Report getReport()
Returns the current report.- Specified by:
getReport
in 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:
getNotes
in interfaceMutableNotesHandler
- Specified by:
getNotes
in interfaceNotesHandler
- Returns:
- the current notes
-
-