Class AbstractMemory

java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractMemory
All Implemented Interfaces:
Comparable<NamedBean>, PropertyChangeProvider, Memory, NamedBean
Direct Known Subclasses:
DefaultMemory

public abstract class AbstractMemory extends AbstractNamedBean implements Memory
Base for the Memory interface.

Implements the parameter binding support.

  • Constructor Details

  • Method Details

    • getBeanType

      public String getBeanType()
      Description copied from interface: NamedBean
      For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.
      Specified by:
      getBeanType in interface NamedBean
      Returns:
      a string of the bean type, eg Turnout, Sensor etc
    • getValue

      public Object getValue()
      Description copied from interface: Memory
      Get the stored value. The type of this depends on what was stored...
      Specified by:
      getValue in interface Memory
      Returns:
      the stored value
    • setValue

      public void setValue(Object v)
      Provide a general method for updating the report. Set the value. Any type of Object can be stored, but various utilities use the toString method of the stored Object.
      Specified by:
      setValue in interface Memory
      Parameters:
      v - the value to store
    • compareSystemNameSuffix

      Compare the suffix of this NamedBean's name with the suffix of the argument NamedBean's name for the NamedBean.compareTo(jmri.NamedBean) operation. This is intended to be a system-specific comparison that understands the various formats, etc. By default, does an alphanumeric-by-chunks comparison. Do a string comparison.
      Specified by:
      compareSystemNameSuffix in interface NamedBean
      Overrides:
      compareSystemNameSuffix in class AbstractNamedBean
      Parameters:
      suffix1 - The suffix for the 1st bean in the comparison
      suffix2 - The suffix for the 2nd bean in the comparison
      n - The other (second) NamedBean in the comparison
      Returns:
      -1,0,+1 for ordering if the names are well-formed; may not provide proper ordering if the names are not well-formed.