## org.opencyc.cycobject
Class CycVariable

    java.lang.Object
      |
      +--org.opencyc.cycobject.CycObject
            |
            +--org.opencyc.cycobject.CycVariable

All Implemented Interfaces:
  java.lang.Comparable

public class CycVariable
extends CycObject
implements java.lang.Comparable

Provides the behavior and attributes of an OpenCyc variable, typically used in rule and query expressions.

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
`static java.lang.String` `cycVariableXMLTag` The name of the XML tag for this object.
`java.lang.Integer` `id` The ID of the `CycVariable`object which is an integer unique within an OpenCyc KB but not necessarily unique globally.``
`java.lang.String` `name` The variable represented as a `String`.

Constructor Summary
`CycVariable()` Constructs a new empty `CycVariable` object.
`CycVariable(java.lang.String name)` Constructs a new `CycVariable` object.

Method Summary
`int` `compareTo(java.lang.Object object)` Compares this object with the specified object for order.
`java.lang.String` `cyclify()` Returns the OpenCyc representation of the `CycVariable`
`java.lang.Object` `cycListApiValue()` Returns this object in a form suitable for use as an `CycList` api expression value.
`boolean` `equals(java.lang.Object object)` Returns `true` some object equals this `CycVariable`
`java.lang.String` `safeToString()` Returns a string representation without causing additional api calls to determine constant names.
`java.lang.String` `stringApiValue()` Returns this object in a form suitable for use as an `String` api expression value.
`java.lang.String` `toString()` Returns the string representation of the `CycVariable`
`void` `toXML(XMLWriter xmlWriter, int indent, boolean relative)` Prints the XML representation of the CycVariable to an `XMLWriter`
`java.lang.String` `toXMLString()` Returns the XML representation of this object.

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

Field Detail

### cycVariableXMLTag

    public static final java.lang.String cycVariableXMLTag

  The name of the XML tag for this object.

### name

    public java.lang.String name

  The variable represented as a `String`.

### id

    public java.lang.Integer id

  The ID of the `CycVariable`object which is an integer unique within an OpenCyc KB but not necessarily unique globally.``

Constructor Detail

### CycVariable

    public CycVariable()

  Constructs a new empty `CycVariable` object.

### CycVariable

    public CycVariable(java.lang.String name)

  Constructs a new `CycVariable` object.
  Parameters:
    `name` - the `String` name of the `CycVariable`.

Method Detail

### toString

    public java.lang.String toString()

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

### safeToString

    public java.lang.String safeToString()

  Returns a string representation without causing additional api calls to determine constant names.
  Returns:
    a string representation without causing additional api calls to determine constant names

### cyclify

    public java.lang.String cyclify()

  Returns the OpenCyc representation of the `CycVariable`
  Overrides:
    `cyclify` in class `CycObject`
  Returns:
    the OpenCyc representation of the `CycVariable` as a `String` prefixed by "?"

### stringApiValue

    public java.lang.String stringApiValue()

  Returns this object in a form suitable for use as an `String` api expression value.
  Returns:
    this object in a form suitable for use as an `String` api expression value

### cycListApiValue

    public java.lang.Object cycListApiValue()

  Returns this object in a form suitable for use as an `CycList` api expression value.
  Returns:
    this object in a form suitable for use as an `CycList` api expression value

### equals

    public boolean equals(java.lang.Object object)

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

### 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

### toXMLString

    public java.lang.String toXMLString()
                                 throws java.io.IOException

  Returns the XML representation of this object.
  Returns:
    the XML representation of this object

### toXML

    public void toXML(XMLWriter xmlWriter,
                      int indent,
                      boolean relative)
               throws java.io.IOException

  Prints the XML representation of the CycVariable to an `XMLWriter`
  Parameters:
    `xmlWriter` - an `XMLWriter`
    `indent` - an int that specifies by how many spaces to indent
    `relative` - a boolean; if true indentation is relative, otherwise absolute