data
Class ClusterSet

java.lang.Object
  extended by data.ClusterSet
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class ClusterSet
extends java.lang.Object
implements java.io.Serializable, javax.swing.table.TableModel

A collection of several Clusters.

See Also:
Serialized Form

Constructor Summary
ClusterSet(DataSheet dataSheet)
          Instantiates a new cluster set.
 
Method Summary
 void addClusterToBuffer()
          Adds a new cluster to the editing buffer.
 void addTableModelListener(javax.swing.event.TableModelListener l)
           
 void applyChanges()
          All changes made to the editing buffer are now applied by copying the buffer to the persistent Vector clusters.
 void createBuffer()
          Creates a buffer by copying the clusters Vector.
 void fireTableChanged()
          Called to update the display of the table
 Cluster getCluster(int i)
          Gets a cluster by index i.
 Cluster getCluster(java.lang.String clusterName)
          Gets a cluster by name.
 int getClusterCount()
          Gets the cluster count.
 java.lang.Class<?> getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int columnIndex)
           
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void removeClusterFromBuffer(Cluster cluster)
          Removes the specified Cluster from the editing buffer.
 void removeClusterFromBuffer(int i)
          Removes a cluster from the editing buffer.
 void removeClusterFromBuffer(java.lang.String clusterName)
          Removes a cluster from buffer by name.
 void removeTableModelListener(javax.swing.event.TableModelListener l)
           
 void setValueAt(java.lang.Object arg0, int rowIndex, int columnIndex)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterSet

public ClusterSet(DataSheet dataSheet)
Instantiates a new cluster set.

Parameters:
dataSheet - the data sheet
Method Detail

getColumnClass

public java.lang.Class<?> getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface javax.swing.table.TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel

getColumnName

public java.lang.String getColumnName(int columnIndex)
Specified by:
getColumnName in interface javax.swing.table.TableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Specified by:
getValueAt in interface javax.swing.table.TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface javax.swing.table.TableModel

setValueAt

public void setValueAt(java.lang.Object arg0,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface javax.swing.table.TableModel

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
addTableModelListener in interface javax.swing.table.TableModel

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
removeTableModelListener in interface javax.swing.table.TableModel

fireTableChanged

public void fireTableChanged()
Called to update the display of the table


addClusterToBuffer

public void addClusterToBuffer()
Adds a new cluster to the editing buffer.


removeClusterFromBuffer

public void removeClusterFromBuffer(int i)
Removes a cluster from the editing buffer.

Parameters:
i - the index of the Cluster to be removed.

removeClusterFromBuffer

public void removeClusterFromBuffer(Cluster cluster)
Removes the specified Cluster from the editing buffer.

Parameters:
cluster - the Cluster to be removed

getCluster

public Cluster getCluster(int i)
Gets a cluster by index i.

Parameters:
i - the index
Returns:
the cluster with index i

getCluster

public Cluster getCluster(java.lang.String clusterName)
Gets a cluster by name.

Parameters:
clusterName - the cluster name
Returns:
the cluster with name clusterName

getClusterCount

public int getClusterCount()
Gets the cluster count.

Returns:
the cluster count

removeClusterFromBuffer

public void removeClusterFromBuffer(java.lang.String clusterName)
Removes a cluster from buffer by name.

Parameters:
clusterName - the name of the Cluster to be removed.

applyChanges

public void applyChanges()
All changes made to the editing buffer are now applied by copying the buffer to the persistent Vector clusters.


createBuffer

public void createBuffer()
Creates a buffer by copying the clusters Vector.

This buffer is used to store modifications that the user makes until he choose to apply the changes made.