Class AbstractCodeTemplate
- java.lang.Object
-
- org.fife.ui.rsyntaxtextarea.templates.AbstractCodeTemplate
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<CodeTemplate>,CodeTemplate
- Direct Known Subclasses:
StaticCodeTemplate
public abstract class AbstractCodeTemplate extends java.lang.Object implements CodeTemplate
A base class to build code templates on top of.- Version:
- 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringidThe 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.Objectclone()Creates a deep copy of this template.intcompareTo(CodeTemplate o)Compares theStaticCodeTemplateto another.booleanequals(java.lang.Object obj)java.lang.StringgetID()Returns the ID of this code template.inthashCode()Returns the hash code for this template.voidsetID(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
-
Methods inherited from interface org.fife.ui.rsyntaxtextarea.templates.CodeTemplate
invoke
-
-
-
-
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- Ifidisnull.
-
-
Method Detail
-
clone
public java.lang.Object clone()
Creates a deep copy of this template.- Specified by:
clonein interfaceCodeTemplate- Overrides:
clonein classjava.lang.Object- Returns:
- A deep copy of this template.
-
compareTo
public int compareTo(CodeTemplate o)
Compares theStaticCodeTemplateto another.- Specified by:
compareToin interfacejava.lang.Comparable<CodeTemplate>- Parameters:
o- AnotherStaticCodeTemplateobject.- 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- Ifois not an instance ofCodeTemplate.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.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:
getIDin interfaceCodeTemplate- Returns:
- The template's ID.
- See Also:
setID(String)
-
hashCode
public int hashCode()
Returns the hash code for this template.- Overrides:
hashCodein classjava.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- Ifidisnull.- See Also:
getID()
-
-