Class AbstractValue

  • Direct Known Subclasses:
    CvValue, VariableValue

    public abstract class AbstractValue
    extends java.lang.Object
    Define common base class methods for CvValue and VariableValue classes

    The ToRead parameter (boolean, unbound) is used to remember whether this object has been read during a "read all" operation. This allows removal of duplicate operations.

    The ToWrite parameter (boolean, unbound) is used to remember whether this object has been written during a "write all" operation. This allows removal of duplicate operations.

    The Available parameter (boolean, unbound) remembers whether the variable should be displayed, programmed, etc.

    Represents a single CV value

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.beans.PropertyChangeSupport prop  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractValue()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addPropertyChangeListener​(java.beans.PropertyChangeListener p)  
      boolean getAvailable()
      Gets the current availability status of the object.
      boolean isToRead()
      Ask whether this object needs to be read.
      boolean isToWrite()
      Ask whether this object needs to be written.
      void removePropertyChangeListener​(java.beans.PropertyChangeListener p)  
      void setAvailable​(boolean avail)
      Sets the availability status of the object.
      (package private) abstract void setColor​(java.awt.Color c)
      Method to handle color changes for states.
      void setToRead​(boolean state)
      Mark whether this object needs to be read.
      void setToWrite​(boolean state)
      Mark whether this object needs to be written.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • prop

        java.beans.PropertyChangeSupport prop
    • Method Detail

      • setColor

        abstract void setColor​(java.awt.Color c)
        Method to handle color changes for states.
        Parameters:
        c - the desired colour
      • setToRead

        public void setToRead​(boolean state)
        Mark whether this object needs to be read.
        Parameters:
        state - true if the object needs to be read, false otherwise
        See Also:
        AbstractValue
      • isToRead

        public boolean isToRead()
        Ask whether this object needs to be read.
        Returns:
        true if the object needs to be read, false otherwise
        See Also:
        AbstractValue
      • setToWrite

        public void setToWrite​(boolean state)
        Mark whether this object needs to be written.
        Parameters:
        state - true if the object needs to be written, false otherwise
        See Also:
        AbstractValue
      • isToWrite

        public boolean isToWrite()
        Ask whether this object needs to be written.
        Returns:
        true if the object needs to be written, false otherwise
        See Also:
        AbstractValue
      • setAvailable

        public void setAvailable​(boolean avail)
        Sets the availability status of the object.
        Parameters:
        avail - true if the object should be made available, false if should be made unavailable
      • getAvailable

        public boolean getAvailable()
        Gets the current availability status of the object.

        Code can use this to determine whether to set object visibility (or other properties).

        Returns:
        true if the object should be available, false if it should be unavailable
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.beans.PropertyChangeListener p)
        Parameters:
        p - the listener to be added to the object
      • removePropertyChangeListener

        public void removePropertyChangeListener​(java.beans.PropertyChangeListener p)
        Parameters:
        p - the listener to be removed from the object