|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.swing.table.AbstractTableModel
|
+--edu.buffalo.fs7.qsymbol2.GateTableModel
This class holds the actual quantum circuit. Gates are represented by GateContainer objects to allow gate groups. The actual gate information is stored in a mathlib variable of the type Gate and each GateContainer has a reference to a Gate variable. The GateTableModel does not autonomously react to MathlibEvents, but rather the GateTable class is taking care of this.
GateTable,
GateTableColumnModel,
GateContainer,
Gate, Serialized Form| Field Summary | |
protected java.util.Vector |
gateContainers
holds names of gate variables |
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
GateTableModel()
creates a GateTableModel. |
|
| Method Summary | |
void |
addGateContainer(GateContainer gateContainer)
adds a GateContainer to the GateTableModel |
void |
addQubit()
adds a qubit by adding a '-' to the gate_descr of each gate contained by the gateContainers in this model. |
boolean |
contains(GateContainer gateContainer)
checks whether a given gateContainer is contained by the GateTableModel |
java.lang.Class |
getColumnClass(int c)
returns always the GateContainer class |
int |
getColumnCount()
gets the number of top level gateContainers (= column count) |
java.lang.String |
getColumnName(int column)
returns the top level name of the gateContainer in column column |
GateContainer |
getGateContainer(java.lang.String name)
returns the gateContainer with the given name, null otherwise |
int |
getRowCount()
returns the dimension of the gates (= qubit number) |
java.lang.Object |
getValueAt(int row,
int col)
returns the gateContainer in the model which corresponds to the column the paramter row is ignored. |
boolean |
isCellEditable(int row,
int col)
returns true if the cell is a preparation operation |
void |
moveQubit(int fromRow,
int toRow)
moves a qubit by exchanging the charakters in the gate_descr for each gateContainer |
void |
removeGateContainer(GateContainer gateContainer)
removes a given gateContainer |
void |
removeGateContainer(int column)
removes a given gateContainer |
void |
removeQubit(int row)
remove a qubit, i.e. for each gateContainer in the model the gate_descr is modiefied. |
void |
setValueAt(java.lang.Object value,
int row,
int col)
method is called in the process of editing a cell. |
void |
tableUpdated()
wraps the fireTableDataChanged() method.... |
| Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, removeTableModelListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Vector gateContainers
| Constructor Detail |
public GateTableModel()
| Method Detail |
public void addGateContainer(GateContainer gateContainer)
gateContainer - the gateContainer object to addpublic int getColumnCount()
getColumnCount in class javax.swing.table.AbstractTableModelpublic int getRowCount()
getRowCount in class javax.swing.table.AbstractTableModelpublic java.lang.Class getColumnClass(int c)
getColumnClass in class javax.swing.table.AbstractTableModelpublic java.lang.String getColumnName(int column)
getColumnName in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int row,
int col)
getValueAt in class javax.swing.table.AbstractTableModelpublic GateContainer getGateContainer(java.lang.String name)
public boolean isCellEditable(int row,
int col)
isCellEditable in class javax.swing.table.AbstractTableModel
public void setValueAt(java.lang.Object value,
int row,
int col)
setValueAt in class javax.swing.table.AbstractTableModelpublic boolean contains(GateContainer gateContainer)
public void removeGateContainer(GateContainer gateContainer)
public void removeGateContainer(int column)
public void removeQubit(int row)
public void moveQubit(int fromRow,
int toRow)
public void addQubit()
public void tableUpdated()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||