|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.cycobject.CycObject | +--org.opencyc.cycobject.CycFort | +--org.opencyc.cycobject.CycConstant
Provides the behavior and attributes of an OpenCyc Constant.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
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 |
constantXMLTag
Field for storing the name of the XML tag for CycConstant objects |
Guid |
guid
The GUID (Globally Unique IDentifier) of the CycConstant object. |
static int |
indentLength
The default indentation for printing CycConstant objects to XML |
java.lang.String |
name
The name of the CycConstant object. |
static java.lang.String |
nameXMLTag
Field for storing the name of the XML tag for the name of CycConstant objects |
Fields inherited from class org.opencyc.cycobject.CycFort |
idXMLTag |
Constructor Summary | |
CycConstant()
Constructs a new incomplete CycConstant object. |
|
CycConstant(java.lang.String name,
Guid guid,
java.lang.Integer id)
Constructs a new CycConstant object from name, guid and id. |
Method Summary | |
java.lang.String |
cyclify()
Returns the name of the CycConstant with "#$" prefixed. |
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 CycConstant. |
Guid |
getGuid()
Gets the guid |
java.lang.Integer |
getId()
Gets the id. |
java.lang.String |
getName()
Gets the name |
int |
hashCode()
Provides the hash code appropriate for the CycConstant. |
static java.lang.String |
makeValidConstantName(java.lang.String candidateName)
Makes a valid constant name from the candidate name by substituting an underline character for the invalid characters. |
java.lang.String |
safeToString()
Returns a string representation without causing additional api calls to determine constant names. |
void |
setGuid(Guid guid)
Sets the guid |
void |
setName(java.lang.String name)
Sets the name |
java.lang.String |
stringApiValue()
Returns this object in a form suitable for use as an String api expression value. |
java.lang.String |
toString()
Returns a String representation of the CycConstant. |
void |
toXML(XMLWriter xmlWriter,
int indent,
boolean relative)
Prints the XML representation of the CycConstant to an XMLWriter |
java.lang.String |
toXMLString()
Returns the XML representation of this object. |
Methods inherited from class org.opencyc.cycobject.CycFort |
compareTo, setId |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
compareTo |
Field Detail |
public static final java.lang.String constantXMLTag
public static final java.lang.String nameXMLTag
public static int indentLength
public Guid guid
public java.lang.String name
Constructor Detail |
public CycConstant()
public CycConstant(java.lang.String name, Guid guid, java.lang.Integer id)
name
- the constant nameguid
- the GUID that uniquely identifies the constant everywhereid
- the id that uniquely identifies the constant on a given OpenCyc serverMethod Detail |
public java.lang.Integer getId()
getId
in class CycFort
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the namepublic Guid getGuid()
public void setGuid(Guid guid)
guid
- the guidpublic java.lang.String toXMLString() throws java.io.IOException
public void toXML(XMLWriter xmlWriter, int indent, boolean relative) throws java.io.IOException
XMLWriter
toXML
in class CycFort
xmlWriter
- an XMLWriterindent
- an int that specifies by how many spaces to indentrelative
- a boolean; if true indentation is relative, otherwise absolutepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the Object for equality comparisonpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String safeToString()
safeToString
in class CycFort
public java.lang.String cyclify()
cyclify
in class CycFort
public java.lang.String stringApiValue()
stringApiValue
in class CycFort
public java.lang.Object cycListApiValue()
cycListApiValue
in class CycFort
public static java.lang.String makeValidConstantName(java.lang.String candidateName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |