Class AbstractMemoryContext<Type>

  • Type Parameters:
    Type - the memory cell type
    All Implemented Interfaces:
    Context, MemoryContext<Type>

    public abstract class AbstractMemoryContext<Type>
    extends java.lang.Object
    implements MemoryContext<Type>
    This class implements some fundamental functionality of MemoryContext interface, that can be useful in the programming of the own memory context.
    • Field Detail

      • listeners

        protected final java.util.Set<Memory.MemoryListener> listeners
        List of all memory listeners. The listeners are objects implementing the IMemoryListener interface. Methods within the listeners are called on some events that happen inside memory (e.g. value change).
    • Constructor Detail

      • AbstractMemoryContext

        public AbstractMemoryContext()
    • Method Detail

      • areMemoryNotificationsEnabled

        public boolean areMemoryNotificationsEnabled()
        Description copied from interface: MemoryContext
        Determine if notifications of memory changes are globally enabled or disabled.
        Specified by:
        areMemoryNotificationsEnabled in interface MemoryContext<Type>
        true if notifications are enabled, false if disabled.
      • setMemoryNotificationsEnabled

        public void setMemoryNotificationsEnabled​(boolean enabled)
        Description copied from interface: MemoryContext
        Enable/disable notifications of memory changes globally.

        Enabled by default.

        Specified by:
        setMemoryNotificationsEnabled in interface MemoryContext<Type>
        enabled - - true if enabled, false if disabled.
      • notifyMemoryChanged

        public void notifyMemoryChanged​(int position)
        Notify all listeners that memory has changed. This method should be called whenever a some plugin writes to the memory.
        position - memory position (address) on which the value has changed
      • notifyMemorySizeChanged

        public void notifyMemorySizeChanged()
        Notify listeners that memory size has changed.