Package adams.gui.visualization.instance
Class InstanceContainer
- java.lang.Object
-
- adams.gui.visualization.container.AbstractContainer
-
- adams.gui.visualization.instance.InstanceContainer
-
- All Implemented Interfaces:
adams.data.id.DatabaseIDHandler
,adams.data.id.IDHandler
,adams.data.id.MutableIDHandler
,adams.gui.visualization.container.ColorContainer
,adams.gui.visualization.container.DatabaseContainer
,adams.gui.visualization.container.NamedContainer
,adams.gui.visualization.container.VisibilityContainer
,Serializable
,Comparable<adams.gui.visualization.container.AbstractContainer>
public class InstanceContainer extends adams.gui.visualization.container.AbstractContainer implements adams.gui.visualization.container.ColorContainer, adams.gui.visualization.container.VisibilityContainer, adams.gui.visualization.container.NamedContainer, adams.gui.visualization.container.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
-
-
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 void
assign(InstanceContainer c)
Updates itself with the values from given container (the manager is excluded!).Color
getColor()
Returns the current color in use.Instance
getData()
Returns the stored instance.int
getDatabaseID()
Returns the database ID.String
getDisplayID()
Returns the displayed container's ID.String
getID()
Returns the container's ID.int
hashCode()
Returns the hashcode of the instance.protected void
initialize()
Initializes members.boolean
isVisible()
Returns whether the instance is visible.void
setColor(Color value)
Sets the color to use.void
setData(Instance value)
Sets the instance.void
setID(String value)
Sets the container's ID.void
setVisible(boolean value)
Sets the instance's visibility.String
toString()
Returns a short string representation of the container.
-
-
-
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:
initialize
in classadams.gui.visualization.container.AbstractContainer
-
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:
setColor
in interfaceadams.gui.visualization.container.ColorContainer
- Parameters:
value
- the color
-
getColor
public Color getColor()
Returns the current color in use.- Specified by:
getColor
in interfaceadams.gui.visualization.container.ColorContainer
- Returns:
- the color
-
setVisible
public void setVisible(boolean value)
Sets the instance's visibility.- Specified by:
setVisible
in interfaceadams.gui.visualization.container.VisibilityContainer
- Parameters:
value
- if true then the instance will be visible
-
isVisible
public boolean isVisible()
Returns whether the instance is visible.- Specified by:
isVisible
in interfaceadams.gui.visualization.container.VisibilityContainer
- 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:
setID
in interfaceadams.data.id.MutableIDHandler
- Specified by:
setID
in interfaceadams.gui.visualization.container.NamedContainer
- Parameters:
value
- the new ID
-
getID
public String getID()
Returns the container's ID.- Specified by:
getID
in interfaceadams.data.id.IDHandler
- Specified by:
getID
in interfaceadams.gui.visualization.container.NamedContainer
- Returns:
- the ID
-
getDisplayID
public String getDisplayID()
Returns the displayed container's ID.- Specified by:
getDisplayID
in interfaceadams.gui.visualization.container.NamedContainer
- Returns:
- the displayed ID
-
getDatabaseID
public int getDatabaseID()
Returns the database ID.- Specified by:
getDatabaseID
in interfaceadams.data.id.DatabaseIDHandler
- 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:
toString
in classadams.gui.visualization.container.AbstractContainer
- Returns:
- a string representation
-
-