Interface IMemoryCell

All Known Implementing Classes:
SimpleMemoryCell

public interface IMemoryCell
Cell in a memory that can hold a single integer value. Cells may hold no value at any point during their lifetime.
Author:
Erik Zemčík
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns currently held integer value of this cell.
    boolean
    Returns if cell currently holds an integer value.
    void
    setValue(int value)
    Sets value held by the cell.
  • Method Details

    • hasValue

      boolean hasValue()
      Returns if cell currently holds an integer value.
      Returns:
      true if currently holds value else false
    • getValue

      int getValue()
      Returns currently held integer value of this cell.
      Returns:
      currently held value
      Throws:
      IllegalStateException - if cell does not hold a value
    • setValue

      void setValue(int value)
      Sets value held by the cell.
      Parameters:
      value - value to set