Package adams.gui.visualization.instance
Class InstanceContainer
- java.lang.Object
-
- adams.gui.visualization.container.AbstractContainer
-
- adams.gui.visualization.instance.InstanceContainer
-
- All Implemented Interfaces:
DatabaseIDHandler,IDHandler,MutableIDHandler,ColorContainer,DatabaseContainer,NamedContainer,VisibilityContainer,Serializable,Comparable<AbstractContainer>
public class InstanceContainer extends AbstractContainer implements ColorContainer, VisibilityContainer, NamedContainer, DatabaseContainer
A container class for a weka.core.Instance wrapped in a weka.core.Instance.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Colorm_Colorthe associated color.protected booleanm_Visiblewhether the instance is visible.-
Fields inherited from class adams.gui.visualization.container.AbstractContainer
m_Manager, m_Payload, m_Updating
-
-
Constructor Summary
Constructors Constructor Description InstanceContainer(InstanceContainerManager manager, Instance data)Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(InstanceContainer c)Updates itself with the values from given container (the manager is excluded!).ColorgetColor()Returns the current color in use.InstancegetData()Returns the stored instance.intgetDatabaseID()Returns the database ID.StringgetDisplayID()Returns the displayed container's ID.StringgetID()Returns the container's ID.inthashCode()Returns the hashcode of the instance.protected voidinitialize()Initializes members.booleanisVisible()Returns whether the instance is visible.voidsetColor(Color value)Sets the color to use.voidsetData(Instance value)Sets the instance.voidsetID(String value)Sets the container's ID.voidsetVisible(boolean value)Sets the instance's visibility.StringtoString()Returns a short string representation of the container.-
Methods inherited from class adams.gui.visualization.container.AbstractContainer
assign, compareTo, copy, equals, getManager, getPayload, invalidate, postProcessPayload, setManager, setPayload
-
-
-
-
Field Detail
-
m_Color
protected Color m_Color
the associated color.
-
m_Visible
protected boolean m_Visible
whether the instance is visible.
-
-
Constructor Detail
-
InstanceContainer
public InstanceContainer(InstanceContainerManager manager, Instance data)
Initializes the container.- Parameters:
manager- the owning managerdata- the instance to encapsulate
-
-
Method Detail
-
initialize
protected void initialize()
Initializes members.- Overrides:
initializein classAbstractContainer
-
assign
public void assign(InstanceContainer c)
Updates itself with the values from given container (the manager is excluded!).- Parameters:
c- the container to get the values from
-
setColor
public void setColor(Color value)
Sets the color to use.- Specified by:
setColorin interfaceColorContainer- Parameters:
value- the color
-
getColor
public Color getColor()
Returns the current color in use.- Specified by:
getColorin interfaceColorContainer- Returns:
- the color
-
setVisible
public void setVisible(boolean value)
Sets the instance's visibility.- Specified by:
setVisiblein interfaceVisibilityContainer- Parameters:
value- if true then the instance will be visible
-
isVisible
public boolean isVisible()
Returns whether the instance is visible.- Specified by:
isVisiblein interfaceVisibilityContainer- Returns:
- true if the instance is visible
-
setData
public void setData(Instance value)
Sets the instance.- Parameters:
value- the instance
-
getData
public Instance getData()
Returns the stored instance.- Returns:
- the instance
-
setID
public void setID(String value)
Sets the container's ID.- Specified by:
setIDin interfaceMutableIDHandler- Specified by:
setIDin interfaceNamedContainer- Parameters:
value- the new ID
-
getID
public String getID()
Returns the container's ID.- Specified by:
getIDin interfaceIDHandler- Specified by:
getIDin interfaceNamedContainer- Returns:
- the ID
-
getDisplayID
public String getDisplayID()
Returns the displayed container's ID.- Specified by:
getDisplayIDin interfaceNamedContainer- Returns:
- the displayed ID
-
getDatabaseID
public int getDatabaseID()
Returns the database ID.- Specified by:
getDatabaseIDin interfaceDatabaseIDHandler- Returns:
- the database ID
-
hashCode
public int hashCode()
Returns the hashcode of the instance.
-
toString
public String toString()
Returns a short string representation of the container.- Overrides:
toStringin classAbstractContainer- Returns:
- a string representation
-
-