Class Name


  • public class Name
    extends java.lang.Object
    Name representation for Item and related structures. Names may be shared between different levels of the item structure in some cases (such as an element that contains only a single value, with several layers of indirection), and this class supports name sharing while retaining the ability to modify the actual name text (necessary to avoid name conflicts in the generated code).
    Author:
    Dennis M. Sosnoski
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean m_checked
      Name checked (and possibly adjusted) for conflicts flag.
      private boolean m_fixed
      Flag for name fixed by user request.
      private java.lang.String m_text
      Actual name text.
    • Constructor Summary

      Constructors 
      Constructor Description
      Name()
      Default constructor.
      Name​(java.lang.String name)
      Constructor.
      Name​(Name base)
      Copy constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getText()
      Get item name.
      boolean isChecked()
      Check if name has been checked for conflicts.
      boolean isFixed()
      Check if name is fixed by configuration.
      void setChecked​(boolean checked)
      Set flag for name checked for conflicts.
      void setText​(java.lang.String name)
      Set item name.
      java.lang.String toString()
      Generate printable description of name.
      • Methods inherited from class java.lang.Object

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

      • m_fixed

        private final boolean m_fixed
        Flag for name fixed by user request.
      • m_checked

        private boolean m_checked
        Name checked (and possibly adjusted) for conflicts flag.
      • m_text

        private java.lang.String m_text
        Actual name text.
    • Constructor Detail

      • Name

        public Name()
        Default constructor. This just creates a non-fixed name with no initial value.
      • Name

        public Name​(java.lang.String name)
        Constructor.
        Parameters:
        name - fixed name text (null if not fixed)
      • Name

        public Name​(Name base)
        Copy constructor.
        Parameters:
        base -
    • Method Detail

      • isFixed

        public boolean isFixed()
        Check if name is fixed by configuration.
        Returns:
        true if fixed, false if not
      • isChecked

        public boolean isChecked()
        Check if name has been checked for conflicts. This flag is used by the actual class generated code (ClassHolder) to track which names have already been entered into the set of names used by a class.
        Returns:
        checked
      • setChecked

        public void setChecked​(boolean checked)
        Set flag for name checked for conflicts. This flag is used by the actual class generated code (ClassHolder) to track which names have already been entered into the set of names used by a class.
        Parameters:
        checked -
      • getText

        public java.lang.String getText()
        Get item name.
        Returns:
        name (null if unspecified)
      • setText

        public void setText​(java.lang.String name)
        Set item name. It is an error to call this method if isFixed() returns true.
        Parameters:
        name - (null if unspecified)
      • toString

        public java.lang.String toString()
        Generate printable description of name. This is intended for use in logging output.
        Overrides:
        toString in class java.lang.Object
        Returns:
        description