## org.opencyc.templateparser
Class Template

    java.lang.Object
      |
      +--org.opencyc.templateparser.Template

All Implemented Interfaces:
  java.lang.Comparable

public class Template
extends java.lang.Object
implements java.lang.Comparable

Contains a template for parsing a particular utterance, phrase or sentence into an performative and arguments.

The user creates a template by telling the following:

> In the context of "everything" the statement "what is the capitol of ?country" means (query (#$capitolCityOfCountry ?city ?country)).

Author:
  Stephen L. Reed

  Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.

  the license

  www.opencyc.org

  OpenCyc at SourceForge

  THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Field Summary
`protected CycFort` `mt` The microtheory in which this template applies, or null if the execution of the performative does not require Cyc.
`protected Performative` `performative` the performative associated with this template
`protected CycList` `templateElements` the elements of this template

Constructor Summary
`protected` `Template(CycFort mt, CycList templateElements, Performative performative)` Constructs a new Template object given the template elements and performative.

Method Summary
`int` `compareTo(java.lang.Object object)` Compares this object with the specified object for order.
`boolean` `equals(java.lang.Object object)` Returns `true` iff some object equals this object
`CycFort` `getMt()` Returns the microtheory
`Performative` `getPerformative()` Returns the performative.
`CycList` `getTemplateElements()` Returns the template elements
`java.lang.String` `toString()` Returns the string representation of the `Template`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### mt

    protected CycFort mt

  The microtheory in which this template applies, or null if the execution of the performative does not require Cyc.

### templateElements

    protected CycList templateElements

  the elements of this template

### performative

    protected Performative performative

  the performative associated with this template

Constructor Detail

### Template

    protected Template(CycFort mt,
                       CycList templateElements,
                       Performative performative)

  Constructs a new Template object given the template elements and performative.
  Parameters:
    `mt` - the microtheory in which this template applies, or null if the execution of the performative does not require Cyc
    `templateElements` - the template elements
    `performative` - the performative

Method Detail

### getMt

    public CycFort getMt()

  Returns the microtheory
  Returns:
    the microtheory in which this template applies

### getTemplateElements

    public CycList getTemplateElements()

  Returns the template elements
  Returns:
    the template elements

### getPerformative

    public Performative getPerformative()

  Returns the performative.
  Returns:
    the performative associated with this template

### compareTo

    public int compareTo(java.lang.Object object)

  Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
  Specified by:
    `compareTo` in interface `java.lang.Comparable`
  Parameters:
    `object` - the reference object with which to compare.
  Returns:
    a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object

### equals

    public boolean equals(java.lang.Object object)

  Returns `true` iff some object equals this object
  Overrides:
    `equals` in class `java.lang.Object`
  Parameters:
    `object` - the `Object` for equality comparison
  Returns:
    equals `boolean` value indicating equality or non-equality.

### toString

    public java.lang.String toString()

  Returns the string representation of the `Template`
  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    the representation of the `Template` as a `String`