Class AttributeEntry


  • public class AttributeEntry
    extends MethodEntry
    This is the symbol table entry for attributes. An attribute is simply two methods with no exceptions or contexts: a get method and, if not readOnly, a set method.
    • Field Detail

      • _readOnly

        public boolean _readOnly
    • Constructor Detail

      • AttributeEntry

        protected AttributeEntry()
    • Method Detail

      • clone

        public java.lang.Object clone()
        Description copied from class: SymtabEntry
        This is a shallow copy clone
        Overrides:
        clone in class MethodEntry
      • generate

        public void generate​(java.util.Hashtable symbolTable,
                             java.io.PrintWriter stream)
        Invoke the attribute generator.
        Overrides:
        generate in class MethodEntry
        Parameters:
        symbolTable - the symbol table is a hash table whose key is a fully qualified type name and whose value is a SymtabEntry or a subclass of SymtabEntry.
        stream - the stream to which the generator should sent its output.
        See Also:
        SymtabEntry
      • generator

        public Generator generator()
        Access the attribute generator.
        Overrides:
        generator in class MethodEntry
        Returns:
        an object which implements the AttributeGen interface.
        See Also:
        AttributeGen
      • readOnly

        public boolean readOnly()
        If true, only a get method will be generated.
        Returns:
        if the attribute is readonly
      • readOnly

        public void readOnly​(boolean readOnly)
        Sets the readOnly parameter
        Parameters:
        readOnly - If true, only a get method will be generated.