Class AbstractContainer
- java.lang.Object
-
- adams.gui.visualization.container.AbstractContainer
-
- All Implemented Interfaces:
Serializable,Comparable<AbstractContainer>
- Direct Known Subclasses:
InstanceContainer,ReportContainer,SpreadSheetRowContainer,TimeseriesContainer,XYSequenceContainer
public abstract class AbstractContainer extends Object implements Serializable, Comparable<AbstractContainer>
A container that is displayed in the list.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractContainerManagerm_Managerthe manager this container belongs to.protected Comparablem_Payloadthe payload.protected booleanm_Updatingwhether an update is currently in progress and notifications are suppressed.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractContainer(AbstractContainerManager manager, Comparable payload)Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(AbstractContainer c)Updates itself with the values from given container (the manager is excluded!).intcompareTo(AbstractContainer o)Compares this object with the specified object for order.AbstractContainercopy()Returns a shallow copy of itself.booleanequals(Object o)Returns whether the two containers have the same ID.AbstractContainerManagergetManager()Returns the current manager.ComparablegetPayload()Returns the current payload.protected voidinitialize()Initializes members.protected voidinvalidate()For invalidating cached data.protected voidpostProcessPayload()For post-processing the payload, just after it got set.voidsetManager(AbstractContainerManager value)Sets the container manager to use.voidsetPayload(Comparable value)Sets the payload.StringtoString()Returns a string representation of the payload.
-
-
-
Field Detail
-
m_Manager
protected AbstractContainerManager m_Manager
the manager this container belongs to.
-
m_Payload
protected Comparable m_Payload
the payload.
-
m_Updating
protected boolean m_Updating
whether an update is currently in progress and notifications are suppressed.
-
-
Constructor Detail
-
AbstractContainer
protected AbstractContainer(AbstractContainerManager manager, Comparable payload)
Initializes the container.- Parameters:
manager- the manager this container belongs topayload- the payload of this container
-
-
Method Detail
-
initialize
protected void initialize()
Initializes members.
-
invalidate
protected void invalidate()
For invalidating cached data.
Default implementation does nothing.
-
setManager
public void setManager(AbstractContainerManager value)
Sets the container manager to use.- Parameters:
value- the manager
-
getManager
public AbstractContainerManager getManager()
Returns the current manager.- Returns:
- the manager
-
setPayload
public void setPayload(Comparable value)
Sets the payload. Calls invalidate().- Parameters:
value- the new payload- See Also:
invalidate(),postProcessPayload()
-
postProcessPayload
protected void postProcessPayload()
For post-processing the payload, just after it got set.
Default implementation does nothing.
-
getPayload
public Comparable getPayload()
Returns the current payload.- Returns:
- the payload
-
assign
public void assign(AbstractContainer c)
Updates itself with the values from given container (the manager is excluded!). Derived classes need to override this method.- Parameters:
c- the container to get the values from
-
copy
public AbstractContainer copy()
Returns a shallow copy of itself.- Returns:
- the copy
-
compareTo
public int compareTo(AbstractContainer o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareToin interfaceComparable<AbstractContainer>- Parameters:
o- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(Object o)
Returns whether the two containers have the same ID.
-
-