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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractCodeTemplate()
This no-arg constructor is required for serialization purposes.AbstractCodeTemplate(String id)
Creates a new template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Creates a deep copy of this template.int
compareTo(CodeTemplate o)
Compares theStaticCodeTemplate
to another.boolean
equals(Object obj)
String
getID()
Returns the ID of this code template.int
hashCode()
Returns the hash code for this template.void
setID(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(String id)
Creates a new template.- Parameters:
id
- The ID for this template.- Throws:
IllegalArgumentException
- Ifid
isnull
.
-
-
Method Detail
-
clone
public Object clone()
Creates a deep copy of this template.- Specified by:
clone
in interfaceCodeTemplate
- Overrides:
clone
in classObject
- Returns:
- A deep copy of this template.
-
compareTo
public int compareTo(CodeTemplate o)
Compares theStaticCodeTemplate
to another.- Specified by:
compareTo
in interfaceComparable<CodeTemplate>
- Parameters:
o
- AnotherStaticCodeTemplate
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
- Ifo
is not an instance ofCodeTemplate
.
-
equals
public boolean equals(Object obj)
-
getID
public String getID()
Returns the ID of this code template.- Specified by:
getID
in interfaceCodeTemplate
- Returns:
- The template's ID.
- See Also:
setID(String)
-
hashCode
public int hashCode()
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
- Ifid
isnull
.- See Also:
getID()
-
-