Class AbstractCodeTemplate

java.lang.Object
org.fife.ui.rsyntaxtextarea.templates.AbstractCodeTemplate
All Implemented Interfaces:
Serializable, Cloneable, Comparable<CodeTemplate>, CodeTemplate
Direct Known Subclasses:
StaticCodeTemplate

public abstract class AbstractCodeTemplate extends Object implements CodeTemplate
A base class to build code templates on top of.
Version:
1.0
See Also:
  • Field Details

    • id

      private String id
      The ID of this template.
  • Constructor Details

    • AbstractCodeTemplate

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

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

    • clone

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

      public int compareTo(CodeTemplate o)
      Compares the StaticCodeTemplate to another.
      Specified by:
      compareTo in interface 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:
      ClassCastException - If o is not an instance of CodeTemplate.
    • equals

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

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

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

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