|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.api.CycObjectFactory
Provides the way to create cyc objects and reuse previously cached instances.
All methods are static.
Collaborates with the CycConnection class which manages the api connections.
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 | |
protected static org.apache.oro.util.Cache |
assertionCache
Least Recently Used Cache of CycAssertions, so that a reference to an existing CycAssertion is returned instead of constructing a duplicate. |
static CycSymbol |
backquote
|
static CycSymbol |
cons
|
protected static org.apache.oro.util.Cache |
cycConstantCacheByGuid
Least Recently Used Cache of CycConstants, so that a reference to an existing CycConstant is returned instead of constructing a duplicate. |
protected static org.apache.oro.util.Cache |
cycConstantCacheById
Least Recently Used Cache of CycConstants, so that a reference to an existing CycConstant is returned instead of constructing a duplicate. |
protected static org.apache.oro.util.Cache |
cycConstantCacheByName
Least Recently Used Cache of CycConstants, so that a reference to an existing CycConstant is returned instead of constructing a duplicate. |
protected static org.apache.oro.util.Cache |
cycNartCache
Least Recently Used Cache of CycNarts, so that a reference to an existing CycNart is returned instead of constructing a duplicate. |
protected static org.apache.oro.util.Cache |
cycSymbolCache
Least Recently Used Cache of CycSymbols, so that a reference to an existing CycSymbol is returned instead of constructing a duplicate. |
protected static org.apache.oro.util.Cache |
cycVariableCache
Least Recently Used Cache of CycVariables, so that a reference to an existing CycVariable is returned instead of constructing a duplicate. |
static CycSymbol |
dot
|
static CycList |
END_CYC_CONNECTION
The api command which is intercepted by the CycProxy agent to close the CycAccess object associated with the connection between this agent and the particular cyc image. |
protected static org.apache.oro.util.Cache |
guidCache
Least Recently Used Cache of guids, so that a reference to an existing Guid is returned instead of constructing a duplicate. |
static CycSymbol |
nil
|
static CycSymbol |
quote
|
protected static int |
suffix
A variable name suffix used to make unique names. |
static CycSymbol |
t
Built in CycSymbols. |
Constructor Summary | |
CycObjectFactory()
|
Method Summary | |
static void |
addAssertionCache(CycAssertion cycAssertion)
Adds the CycAssertion to the cache. |
static void |
addCycConstantCacheByGuid(CycConstant cycConstant)
Adds the CycConstant to the cache by guid. |
static void |
addCycConstantCacheById(CycConstant cycConstant)
Adds the CycConstant to the cyc contstant cache by id. |
static void |
addCycConstantCacheByName(CycConstant cycConstant)
Adds the CycConstant to the cache by name. |
static void |
addCycNartCache(CycNart cycNart)
Adds the CycNart to the cache. |
static void |
addCycVariableCache(CycVariable cycVariable)
Adds the CycVariable to the cache. |
static void |
addGuidCache(Guid guid)
Adds the Guid to the cache. |
static CycAssertion |
getAssertionCache(java.lang.Integer id)
Retrieves the CycAssertion with id, returning null if not found in the cache. |
static int |
getAssertionCacheSize()
Returns the size of the CycAssertion object cache. |
static CycConstant |
getCycConstantCacheByGuid(Guid guid)
Retrieves the CycConstant with guid, returning null if not found in the cache. |
static CycConstant |
getCycConstantCacheById(java.lang.Integer id)
Retrieves the CycConstant with id, returning null if not found in the cache. |
static int |
getCycConstantCacheByIdSize()
Returns the size of the CycConstant object cache by id. |
static CycConstant |
getCycConstantCacheByName(java.lang.String name)
Retrieves the CycConstant with name, returning null if not found in the cache. |
static int |
getCycConstantCacheByNameSize()
Returns the size of the CycConstant object cache by id. |
static CycNart |
getCycNartCache(java.lang.Integer id)
Retrieves the CycNart with name, returning null if not found in the cache. |
static int |
getCycNartCacheSize()
Returns the size of the CycNart object cache. |
static CycSymbol |
getCycSymbolCache(java.lang.String symbolName)
Retrieves the CycSymbol with symbolName, returning null if not found in the cache. |
static int |
getCycSymbolCacheSize()
Returns the size of the Guid object cache. |
static CycVariable |
getCycVariableCache(java.lang.String name)
Retrieves the CycVariable with name, returning null if not found in the cache. |
static int |
getCycVariableCacheSize()
Returns the size of the CycVariable object cache. |
static Guid |
getGuidCache(java.lang.String guidName)
Retrieves the Guid with guidName, returning null if not found in the cache. |
static int |
getGuidCacheSize()
Returns the size of the Guid object cache. |
static CycSymbol |
makeCycSymbol(java.lang.String symbolNameAnyCase)
Constructs a new CycSymbol object. |
static CycVariable |
makeCycVariable(java.lang.String name)
Constructs a new CycVariable object using the variable name. |
static Guid |
makeGuid(java.lang.String guidString)
Returns a cached Guid object or construct a new Guid object from a guid string if the guid is not found in the cache. |
static CycVariable |
makeUniqueCycVariable(CycVariable modelCycVariable)
Constructs a new CycVariable object by suffixing the given variable. |
static void |
removeAssertionCache(java.lang.Integer id)
Removes the CycAssertion from the cache if it is contained within. |
static void |
removeCaches(CycConstant cycConstant)
Removes the CycConstant from the caches if it is contained within. |
static void |
removeCycNartCache(CycNart cycNart)
Removes the CycNart from the cache if it is contained within. |
static void |
removeCycSymbolCache(CycSymbol cycSymbol)
Removes the CycSymbol from the cache if it is contained within. |
static void |
removeCycVariableCache(CycVariable cycVariable)
Removes the CycVariable from the cache if it is contained within. |
static void |
removeGuidCache(Guid guid)
Removes the Guid from the cache if it is contained within. |
static void |
resetAssertionCache()
Resets the Cyc assertion cache. |
static void |
resetCaches()
Resets all the caches. |
static void |
resetCycConstantCaches()
Resets the Cyc constant caches. |
static void |
resetCycNartCache()
Resets the CycNart cache. |
static void |
resetCycSymbolCache()
Resets the CycSymbol cache. |
static void |
resetCycVariableCache()
Resets the CycVariable cache. |
static void |
resetGuidCache()
Resets the Guid cache. |
static java.lang.Object |
unmarshall(java.lang.String xmlString)
Unmarshalls a cyc object from an XML representation. |
protected static ByteArray |
unmarshallByteArray(org.jdom.Element byteArrayElement,
org.jdom.Document document)
Unmarshalls a ByteArray from the given element in an XML Document object. |
protected static CycAssertion |
unmarshallCycAssertion(org.jdom.Element cycAssertionElement)
Unmarshalls a CycAssertion from the given element in an XML Document object. |
protected static CycConstant |
unmarshallCycConstant(org.jdom.Element cycConstantElement,
org.jdom.Document document)
Unmarshalls a CycConstant from the given element in an XML Document object. |
protected static CycList |
unmarshallCycList(org.jdom.Element cycListElement,
org.jdom.Document document)
Unmarshalls a CycList from the given element in an XML Document object. |
protected static CycNart |
unmarshallCycNart(org.jdom.Element cycNartElement,
org.jdom.Document document)
Unmarshalls a CycNart from the given element in an XML Document object. |
protected static CycSymbol |
unmarshallCycSymbol(org.jdom.Element cycSymbolElement)
Unmarshalls a CycSymbol from the given element in an XML Document object. |
protected static CycVariable |
unmarshallCycVariable(org.jdom.Element cycVariableElement)
Unmarshalls a CycVariable from the given element in an XML Document object. |
protected static java.lang.Object |
unmarshallElement(org.jdom.Element element,
org.jdom.Document document)
Unmarshalls a cyc object from the given element in an XML Document object. |
protected static Guid |
unmarshallGuid(org.jdom.Element guidElement)
Unmarshalls a Guid from the given element in an XML Document object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.oro.util.Cache cycSymbolCache
public static CycSymbol t
public static CycSymbol nil
public static CycSymbol quote
public static CycSymbol backquote
public static CycSymbol cons
public static CycSymbol dot
public static final CycList END_CYC_CONNECTION
protected static org.apache.oro.util.Cache cycConstantCacheByName
protected static org.apache.oro.util.Cache cycConstantCacheById
protected static org.apache.oro.util.Cache cycConstantCacheByGuid
protected static org.apache.oro.util.Cache cycNartCache
protected static org.apache.oro.util.Cache assertionCache
protected static org.apache.oro.util.Cache cycVariableCache
protected static int suffix
protected static org.apache.oro.util.Cache guidCache
Constructor Detail |
public CycObjectFactory()
Method Detail |
public static CycSymbol makeCycSymbol(java.lang.String symbolNameAnyCase)
symbolName
- a String name.public static void resetCycSymbolCache()
public static CycSymbol getCycSymbolCache(java.lang.String symbolName)
public static void removeCycSymbolCache(CycSymbol cycSymbol)
public static int getCycSymbolCacheSize()
public static void resetCaches()
public static void resetCycConstantCaches()
public static void addCycConstantCacheById(CycConstant cycConstant)
public static void addCycConstantCacheByName(CycConstant cycConstant)
public static void addCycConstantCacheByGuid(CycConstant cycConstant)
public static CycConstant getCycConstantCacheById(java.lang.Integer id)
public static CycConstant getCycConstantCacheByName(java.lang.String name)
public static CycConstant getCycConstantCacheByGuid(Guid guid)
public static void removeCaches(CycConstant cycConstant)
public static int getCycConstantCacheByIdSize()
public static int getCycConstantCacheByNameSize()
public static void resetCycNartCache()
public static void addCycNartCache(CycNart cycNart)
public static CycNart getCycNartCache(java.lang.Integer id)
public static void removeCycNartCache(CycNart cycNart)
public static int getCycNartCacheSize()
public static void resetAssertionCache()
public static void addAssertionCache(CycAssertion cycAssertion)
public static CycAssertion getAssertionCache(java.lang.Integer id)
public static void removeAssertionCache(java.lang.Integer id)
public static int getAssertionCacheSize()
public static CycVariable makeCycVariable(java.lang.String name)
name
- a String name.public static CycVariable makeUniqueCycVariable(CycVariable modelCycVariable)
modelCycVariable
- a CycVariable to suffixpublic static void resetCycVariableCache()
public static void addCycVariableCache(CycVariable cycVariable)
public static CycVariable getCycVariableCache(java.lang.String name)
public static void removeCycVariableCache(CycVariable cycVariable)
public static int getCycVariableCacheSize()
public static Guid makeGuid(java.lang.String guidString)
guid
- a String form of a GUID.public static void addGuidCache(Guid guid)
public static void resetGuidCache()
public static Guid getGuidCache(java.lang.String guidName)
public static void removeGuidCache(Guid guid)
public static int getGuidCacheSize()
public static java.lang.Object unmarshall(java.lang.String xmlString) throws org.jdom.JDOMException, java.io.IOException
xmlString
- the XML representation of the cyc objectprotected static java.lang.Object unmarshallElement(org.jdom.Element element, org.jdom.Document document) throws java.io.IOException
element
- the element representing the cyc objectdocument
- the XML document containing the elementprotected static Guid unmarshallGuid(org.jdom.Element guidElement)
guidElement
- the guid xml elementprotected static CycSymbol unmarshallCycSymbol(org.jdom.Element cycSymbolElement)
cycSymbolElement
- the CycSymbol xml elementprotected static CycAssertion unmarshallCycAssertion(org.jdom.Element cycAssertionElement)
cycAssertionElement
- the CycAssertion xml elementprotected static CycVariable unmarshallCycVariable(org.jdom.Element cycVariableElement)
cycVariableElement
- the CycVariable xml elementprotected static CycConstant unmarshallCycConstant(org.jdom.Element cycConstantElement, org.jdom.Document document)
cycConstantElement
- the element representing the CycConstantdocument
- the XML document containing the elementprotected static CycNart unmarshallCycNart(org.jdom.Element cycNartElement, org.jdom.Document document) throws java.io.IOException
cycNartElement
- the element representing the CycNartdocument
- the XML document containing the elementprotected static CycList unmarshallCycList(org.jdom.Element cycListElement, org.jdom.Document document) throws java.io.IOException
cycListElement
- the element representing the CycListdocument
- the XML document containing the elementprotected static ByteArray unmarshallByteArray(org.jdom.Element byteArrayElement, org.jdom.Document document) throws java.io.IOException
byteArrayElement
- the element representing the CycListdocument
- the XML document containing the element
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |