|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.FilterOutputStream | +--java.io.BufferedOutputStream | +--org.opencyc.api.CfaslOutputStream
A CFASL translating buffered output stream. All Java-native types which have logical sublisp equivalents are translated automatically by this stream. Classes implementing the CfaslTranslatingObject interface are translated using their writeObject() method. Other CYC objects, such as binding-lists and formulas, should be explicitly coerced before being sent, unless they inherit from a class which can be translated automatically.
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 int |
API_TRACE_DETAILED
Detailed api trace. |
static int |
API_TRACE_MESSAGES
Message-level api trace. |
static int |
API_TRACE_NONE
No api trace. |
protected static int |
CFASL_ASSERTION
|
protected static int |
CFASL_ASSERTION_DEF
|
protected static int |
CFASL_ASSERTION_SHELL
|
protected static int |
CFASL_AXIOM
|
protected static int |
CFASL_AXIOM_DEF
|
protected static int |
CFASL_BTREE_HIGH
|
protected static int |
CFASL_BTREE_LEAF
|
protected static int |
CFASL_BTREE_LOW
|
protected static int |
CFASL_BTREE_LOW_HIGH
|
protected static int |
CFASL_BYTE_VECTOR
|
protected static int |
CFASL_CHARACTER
|
protected static int |
CFASL_CONSTANT
|
protected static int |
CFASL_DICTIONARY
|
protected static int |
CFASL_DOTTED
|
protected static int |
CFASL_GUID
|
protected static int |
CFASL_HASHTABLE
|
protected static int |
CFASL_IMMEDIATE_FIXNUM_CUTOFF
Binary values for assembling CFASL messages. |
protected static int |
CFASL_IMMEDIATE_FIXNUM_OFFSET
|
protected static int |
CFASL_INDEX
|
protected static int |
CFASL_KEYWORD
|
protected static int |
CFASL_LIST
|
protected static int |
CFASL_N_16BIT_INT
|
protected static int |
CFASL_N_24BIT_INT
|
protected static int |
CFASL_N_32BIT_INT
|
protected static int |
CFASL_N_8BIT_INT
|
protected static int |
CFASL_N_BIGNUM
|
protected static int |
CFASL_N_FLOAT
|
protected static int |
CFASL_NART
|
protected static int |
CFASL_NIL
|
protected static int |
CFASL_P_16BIT_INT
|
protected static int |
CFASL_P_24BIT_INT
|
protected static int |
CFASL_P_32BIT_INT
|
protected static int |
CFASL_P_8BIT_INT
|
protected static int |
CFASL_P_BIGNUM
|
protected static int |
CFASL_P_FLOAT
|
protected static int |
CFASL_SERVER_DEATH
|
protected static int |
CFASL_SOURCE
|
protected static int |
CFASL_SOURCE_DEF
|
protected static int |
CFASL_SPECIAL_OBJECT
|
protected static int |
CFASL_STRING
|
protected static int |
CFASL_SYMBOL
|
protected static int |
CFASL_VARIABLE
|
protected static int |
CFASL_VECTOR
|
int |
trace
Parameter that, when true, causes a trace of the messages to and from the server. |
Fields inherited from class java.io.BufferedOutputStream |
buf, count |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary | |
CfaslOutputStream(java.io.OutputStream out)
Creates a new CfaslOutputStream to write data to the specified underlying output stream with the default buffer size. |
|
CfaslOutputStream(java.io.OutputStream out,
int size)
Creates a new CfaslOutputStream to write data to the specified underlying output stream with the specified buffer size. |
Method Summary | |
void |
writeAssertion(CycAssertion cycAssertion)
Writes a CycAssertion object to this CfaslOutputStream. |
void |
writeBigInteger(java.math.BigInteger v)
Writes a BigInteger to this CFASL output stream as a CFASL Bignum (unless it is small enough to be transmitted as a CFASL Fixnum, in which case it is passed on to writeFixnum(long)). |
protected void |
writeBignum(long v)
Writes a long integer to this CFASL output stream as a Bignum. |
void |
writeBoolean(boolean v)
Writes a boolean onto this CFASL output stream. |
void |
writeByteArray(byte[] bytes)
Writes a byte array to this CfaslOutputStream. |
void |
writeChar(char v)
Writes a one byte character onto this CFASL output stream. |
void |
writeConstant(CycConstant cycConstant)
Writes a CycConstant object to this CfaslOutputStream. |
void |
writeDottedList(CycList dottedList)
Writes an improper (dotted) CycList of Objects to this CfaslOutputStream as a CFASL dotted list. |
void |
writeDouble(double v)
Writes a double onto this CfaslOutputStream. |
protected void |
writeFixnum(int v)
Writes an integer to this CFASL output stream as a Fixnum. |
void |
writeGuid(Guid guid)
Writes a Guid object to this CfaslOutputStream. |
void |
writeInt(long v)
Writes a long integer to this CFASL output stream. |
void |
writeKeyword(CycSymbol cycSymbol)
Writes a keyword symbol object to this CfaslOutputStream. |
void |
writeList(java.util.List list)
Writes a List of Objects to this CfaslOutputStream as a CFASL List. |
void |
writeList(java.lang.Object[] list)
Writes an array of Objects to this CfaslOutputStream as a CFASL List. |
void |
writeNart(CycNart cycNart)
Writes a CycNart object to this CfaslOutputStream. |
void |
writeObject(java.lang.Object o)
Writes a generic object to this CfaslOutputStream. |
void |
writeString(java.lang.String s)
Writes a String to this CfaslOutputStream. |
void |
writeSymbol(CycSymbol cycSymbol)
Writes a CycSymbol object to this CfaslOutputStream. |
void |
writeVariable(CycVariable cycVariable)
Writes a CycVariable object to this CfaslOutputStream. |
Methods inherited from class java.io.BufferedOutputStream |
flush, write, write |
Methods inherited from class java.io.FilterOutputStream |
close, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int API_TRACE_NONE
public static final int API_TRACE_MESSAGES
public static final int API_TRACE_DETAILED
public int trace
protected static final int CFASL_IMMEDIATE_FIXNUM_CUTOFF
protected static final int CFASL_IMMEDIATE_FIXNUM_OFFSET
protected static final int CFASL_P_8BIT_INT
protected static final int CFASL_N_8BIT_INT
protected static final int CFASL_P_16BIT_INT
protected static final int CFASL_N_16BIT_INT
protected static final int CFASL_P_24BIT_INT
protected static final int CFASL_N_24BIT_INT
protected static final int CFASL_P_32BIT_INT
protected static final int CFASL_N_32BIT_INT
protected static final int CFASL_P_FLOAT
protected static final int CFASL_N_FLOAT
protected static final int CFASL_KEYWORD
protected static final int CFASL_SYMBOL
protected static final int CFASL_NIL
protected static final int CFASL_LIST
protected static final int CFASL_VECTOR
protected static final int CFASL_STRING
protected static final int CFASL_CHARACTER
protected static final int CFASL_DOTTED
protected static final int CFASL_HASHTABLE
protected static final int CFASL_BTREE_LOW_HIGH
protected static final int CFASL_BTREE_LOW
protected static final int CFASL_BTREE_HIGH
protected static final int CFASL_BTREE_LEAF
protected static final int CFASL_P_BIGNUM
protected static final int CFASL_N_BIGNUM
protected static final int CFASL_GUID
protected static final int CFASL_BYTE_VECTOR
protected static final int CFASL_CONSTANT
protected static final int CFASL_NART
protected static final int CFASL_ASSERTION
protected static final int CFASL_ASSERTION_SHELL
protected static final int CFASL_ASSERTION_DEF
protected static final int CFASL_SOURCE
protected static final int CFASL_SOURCE_DEF
protected static final int CFASL_AXIOM
protected static final int CFASL_AXIOM_DEF
protected static final int CFASL_VARIABLE
protected static final int CFASL_INDEX
protected static final int CFASL_SPECIAL_OBJECT
protected static final int CFASL_DICTIONARY
protected static final int CFASL_SERVER_DEATH
Constructor Detail |
public CfaslOutputStream(java.io.OutputStream out)
out
- the underlying output stream.public CfaslOutputStream(java.io.OutputStream out, int size)
out
- the underlying output stream.size
- the buffer size.Method Detail |
public void writeBoolean(boolean v) throws java.io.IOException
v
- the boolean value to be writtenpublic void writeChar(char v) throws java.io.IOException
v
- the character to be writtenpublic void writeInt(long v) throws java.io.IOException
the
- long integer to be writtenprotected void writeFixnum(int v) throws java.io.IOException
v
- the integer to be writtenprotected void writeBignum(long v) throws java.io.IOException
v
- the long integer to be writtenpublic void writeBigInteger(java.math.BigInteger v) throws java.io.IOException
v
- the BigInteger to be writtenpublic void writeDouble(double v) throws java.io.IOException
v
- the double value to be writtenpublic void writeString(java.lang.String s) throws java.io.IOException
s
- the string to be writtenpublic void writeByteArray(byte[] bytes) throws java.io.IOException
bytes
- the byte array to be written.public void writeList(java.util.List list) throws java.io.IOException
list
- the list of objects to be writtenpublic void writeDottedList(CycList dottedList) throws java.io.IOException
improperList
- the list of objects to be writtenpublic void writeList(java.lang.Object[] list) throws java.io.IOException
list
- the array of objects to be writtenpublic void writeGuid(Guid guid) throws java.io.IOException
guid
- the Guid to be writtenpublic void writeSymbol(CycSymbol cycSymbol) throws java.io.IOException
cycSymbol
- the CycSymbol to be writtenpublic void writeKeyword(CycSymbol cycSymbol) throws java.io.IOException
cycSymbol
- the keyword to be writtenpublic void writeVariable(CycVariable cycVariable) throws java.io.IOException
cycVariable
- the CycVariable to be writtenpublic void writeConstant(CycConstant cycConstant) throws java.io.IOException
cycConstant
- the CycConstant to be writtenpublic void writeNart(CycNart cycNart) throws java.io.IOException
cycNart
- the CycNart to be writtenpublic void writeAssertion(CycAssertion cycAssertion) throws java.io.IOException
cycAssertion
- the CycAssertion to be writtenpublic void writeObject(java.lang.Object o) throws java.io.IOException
o
- the object to be writtenjava.lang.RuntimeException
- if the Object cannot be translated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |