Class AbstractCodeTemplate

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String id
      The ID of this template.
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractCodeTemplate()
      This no-arg constructor is required for serialization purposes.
      AbstractCodeTemplate​(java.lang.String id)
      Creates a new template.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Creates a deep copy of this template.
      int compareTo​(CodeTemplate o)
      Compares the StaticCodeTemplate to another.
      boolean equals​(java.lang.Object obj)
      Overridden to return "true" iff compareTo(CodeTemplate) returns 0.
      java.lang.String getID()
      Returns the ID of this code template.
      int hashCode()
      Returns the hash code for this template.
      void setID​(java.lang.String id)
      Sets the ID for this template.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • id

        private java.lang.String id
        The ID of this template.
    • Constructor Detail

      • AbstractCodeTemplate

        public AbstractCodeTemplate()
        This no-arg constructor is required for serialization purposes.
      • AbstractCodeTemplate

        public AbstractCodeTemplate​(java.lang.String id)
        Creates a new template.
        Parameters:
        id - The ID for this template.
        Throws:
        java.lang.IllegalArgumentException - If id is null.
    • Method Detail

      • clone

        public java.lang.Object clone()
        Creates a deep copy of this template.
        Specified by:
        clone in interface CodeTemplate
        Overrides:
        clone in class java.lang.Object
        Returns:
        A deep copy of this template.
      • compareTo

        public int compareTo​(CodeTemplate o)
        Compares the StaticCodeTemplate to another.
        Specified by:
        compareTo in interface java.lang.Comparable<CodeTemplate>
        Parameters:
        o - Another StaticCodeTemplate object.
        Returns:
        A negative integer, zero, or a positive integer as this object is less than, equal-to, or greater than the passed-in object.
        Throws:
        java.lang.ClassCastException - If o is not an instance of CodeTemplate.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overridden to return "true" iff compareTo(CodeTemplate) returns 0.
        Overrides:
        equals in class java.lang.Object
        Returns:
        Whether this code template is equal to another.
      • getID

        public java.lang.String getID()
        Returns the ID of this code template.
        Specified by:
        getID in interface CodeTemplate
        Returns:
        The template's ID.
        See Also:
        setID(String)
      • hashCode

        public int hashCode()
        Returns the hash code for this template.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code for this template.
      • setID

        public void setID​(java.lang.String id)
        Sets the ID for this template.
        Parameters:
        id - The ID for this template.
        Throws:
        java.lang.IllegalArgumentException - If id is null.
        See Also:
        getID()