Simple Machine

ISA
Class Region

java.lang.Object
  extended by java.util.Observable
      extended by Util.AbstractDataModel
          extended by ISA.Region
All Implemented Interfaces:
DataModel
Direct Known Subclasses:
DataRegion, InstructionRegion

public abstract class Region
extends AbstractDataModel

The code description of a contiguous range of memory. Maintains mapping between memory values and ISA definitions that underly them. Proivdes DataModel interface that keeps Gui's view of ISA information in synch with values in memory.


Nested Class Summary
 class Region.AssemblyString
           
static interface Region.ByteLengthChangedListener
           
 class Region.LabelString
           
static class Region.Type
           
 
Method Summary
protected  void add(MemoryCell cell)
          Add cell to region.
 void addByteLengthChangedListener(Region.ByteLengthChangedListener l)
           
 int byteLength()
           
 boolean canDeleteRow(int row)
          Report whether delete of specified row would suceed given the current state of the system.
 boolean canInsertRow(int row)
          Report whether an insert of the specified row would succeed given the current state of the system.
 boolean deleteRow(int row)
          Delete row in region.
protected  void fireByteLengthChanged()
           
 int getAddress()
           
 MemoryCell getCellForRowIndex(int rowIndex)
           
 int getRowCount()
           
 int getRowIndexForAddress(int address)
           
 java.util.Vector<MemoryCell> getSavableRows()
           
 Region.Type getType()
           
 boolean insertRow(int row)
          Insert new row in region, adding a place-holder cell and adjusting the address of all subsequent cells.
 int length()
           
protected  void replace(java.util.Vector<MemoryCell> removeCells, java.util.Vector<MemoryCell> addCells)
           
 
Methods inherited from class Util.AbstractDataModel
addUndoableEditListener, getColumnClass, getColumnCount, getColumnName, getValueAt, isCellEditable, setValueAt, setValueAt, setValueAtByUser, setValueAtByUser, tellObservers, tellObservers
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Util.DataModel
addObserver
 

Method Detail

getSavableRows

public java.util.Vector<MemoryCell> getSavableRows()

getType

public Region.Type getType()

length

public int length()

getAddress

public int getAddress()

byteLength

public int byteLength()

getCellForRowIndex

public MemoryCell getCellForRowIndex(int rowIndex)

getRowIndexForAddress

public int getRowIndexForAddress(int address)

insertRow

public boolean insertRow(int row)
Insert new row in region, adding a place-holder cell and adjusting the address of all subsequent cells.

Specified by:
insertRow in interface DataModel
Overrides:
insertRow in class AbstractDataModel
Returns:
true iff row is inserted.

canInsertRow

public boolean canInsertRow(int row)
Report whether an insert of the specified row would succeed given the current state of the system.

Specified by:
canInsertRow in interface DataModel
Overrides:
canInsertRow in class AbstractDataModel

deleteRow

public boolean deleteRow(int row)
Delete row in region.

Specified by:
deleteRow in interface DataModel
Overrides:
deleteRow in class AbstractDataModel
Returns:
true iff row is deleted.

canDeleteRow

public boolean canDeleteRow(int row)
Report whether delete of specified row would suceed given the current state of the system.

Specified by:
canDeleteRow in interface DataModel
Overrides:
canDeleteRow in class AbstractDataModel

add

protected void add(MemoryCell cell)
Add cell to region. Ensure that memory reflects the value in the cell. If the cell is already in the region, writing to memory will cause an up call to the region that will update the cell to reflect memory.


replace

protected void replace(java.util.Vector<MemoryCell> removeCells,
                       java.util.Vector<MemoryCell> addCells)

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface DataModel
Overrides:
getRowCount in class AbstractDataModel

addByteLengthChangedListener

public void addByteLengthChangedListener(Region.ByteLengthChangedListener l)

fireByteLengthChanged

protected void fireByteLengthChanged()

Simple Machine