001package jmri;
002
003/**
004 * Represent a Memory, a place to store values.
005 * <p>
006 * The AbstractMemory class contains a basic implementation of the state and
007 * messaging code, and forms a useful start for a system-specific
008 * implementation. 
009 * <p>
010 * The states and names are Java Bean parameters, so that listeners can be
011 * registered to be notified of any changes.
012 * <p>
013 * Each Memory object has a two names. The "user" name is entirely free form,
014 * and can be used for any purpose. The "system" name is provided by the
015 * system-specific implementations, and provides a unique mapping to the layout
016 * control system (for example LocoNet or NCE) and address within that system.
017 * <br>
018 * <hr>
019 * This file is part of JMRI.
020 * <p>
021 * JMRI is free software; you can redistribute it and/or modify it under the
022 * terms of version 2 of the GNU General Public License as published by the Free
023 * Software Foundation. See the "COPYING" file for a copy of this license.
024 * <p>
025 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY
026 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
027 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
028 *
029 * @author Bob Jacobsen Copyright (C) 2001
030 * @see jmri.implementation.AbstractMemory
031 * @see jmri.MemoryManager
032 * @see jmri.InstanceManager
033 */
034public interface Memory extends NamedBean {
035
036    /**
037     * Get the stored value. The type of this depends on what was stored...
038     *
039     * @return the stored value
040     */
041    Object getValue();
042
043    /**
044     * Set the value. Any type of Object can be stored, but various utilities
045     * use the toString method of the stored Object.
046     *
047     * @param value the value to store
048     */
049    void setValue(Object value);
050
051}