Changeset 11387


Ignore:
Timestamp:
11/09/08 11:29:07 (13 years ago)
Author:
ehuelsmann
Message:

Document API that Java-side Lisp streams need to implement.
Add some @Override markers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/Stream.java

    r11377 r11387  
    3737import java.util.BitSet;
    3838
     39
     40/** The stream class
     41 *
     42 * A base class for all Lisp built-in streams.
     43 *
     44 */
    3945public class Stream extends LispObject
    4046{
     
    5662  private Writer writer;
    5763
    58   // The number of characters on the current line of output (-1 if unknown).
     64  /** The number of characters on the current line of output
     65   *
     66   * Used to determine whether additional line feeds are
     67   * required when calling FRESH-LINE
     68   */
    5969  protected int charPos;
    6070
     
    189199  }
    190200
     201  @Override
    191202  public LispObject typeOf()
    192203  {
     
    194205  }
    195206
     207  @Override
    196208  public LispObject classOf()
    197209  {
     
    199211  }
    200212
     213  @Override
    201214  public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable
    202215  {
     
    15191532  }
    15201533
     1534  @Override
    15211535  public String toString()
    15221536  {
     
    16191633  }
    16201634
    1621   // Returns -1 at end of file.
     1635  /** Reads a character off an underlying stream
     1636   *
     1637   * @return a character, or -1 at end-of-file
     1638   * @throws org.armedbear.lisp.ConditionThrowable
     1639   */
    16221640  protected int _readChar() throws ConditionThrowable
    16231641  {
     
    16481666  }
    16491667
     1668  /** Puts a character back into the (underlying) stream
     1669   *
     1670   * @param n
     1671   * @throws org.armedbear.lisp.ConditionThrowable
     1672   */
    16501673  protected void _unreadChar(int n) throws ConditionThrowable
    16511674  {
     
    16681691  }
    16691692
     1693  /** Returns a boolean indicating input readily available
     1694   *
     1695   * @return true if a character is available
     1696   * @throws org.armedbear.lisp.ConditionThrowable
     1697   */
    16701698  protected boolean _charReady() throws ConditionThrowable
    16711699  {
     
    16871715  }
    16881716
     1717  /** Writes a character into the underlying stream,
     1718   * updating charPos while doing so
     1719   *
     1720   * @param c
     1721   * @throws org.armedbear.lisp.ConditionThrowable
     1722   */
    16891723  public void _writeChar(char c) throws ConditionThrowable
    16901724  {
     
    17111745  }
    17121746
     1747  /** Writes a series of characters in the underlying stream,
     1748   * updating charPos while doing so
     1749   *
     1750   * @param chars
     1751   * @param start
     1752   * @param end
     1753   * @throws org.armedbear.lisp.ConditionThrowable
     1754   */
    17131755  public void _writeChars(char[] chars, int start, int end)
    17141756    throws ConditionThrowable
     
    17501792  }
    17511793
     1794  /** Writes a string to the underlying stream,
     1795   * updating charPos while doing so
     1796   *
     1797   * @param s
     1798   * @throws org.armedbear.lisp.ConditionThrowable
     1799   */
    17521800  public void _writeString(String s) throws ConditionThrowable
    17531801  {
     
    17771825  }
    17781826
     1827  /** Writes a string to the underlying stream, appending
     1828   * a new line and updating charPos while doing so
     1829   *
     1830   * @param s
     1831   * @throws org.armedbear.lisp.ConditionThrowable
     1832   */
    17791833  public void _writeLine(String s) throws ConditionThrowable
    17801834  {
     
    17981852
    17991853  // Reads an 8-bit byte.
     1854  /** Reads an 8-bit byte off the underlying stream
     1855   *
     1856   * @return
     1857   * @throws org.armedbear.lisp.ConditionThrowable
     1858   */
    18001859  public int _readByte() throws ConditionThrowable
    18011860  {
     
    18131872
    18141873  // Writes an 8-bit byte.
     1874  /** Writes an 8-bit byte off the underlying stream
     1875   *
     1876   * @param n
     1877   * @throws org.armedbear.lisp.ConditionThrowable
     1878   */
    18151879  public void _writeByte(int n) throws ConditionThrowable
    18161880  {
     
    18301894  }
    18311895
     1896  /** Flushes any buffered output in the (underlying) stream
     1897   *
     1898   * @throws org.armedbear.lisp.ConditionThrowable
     1899   */
    18321900  public void _finishOutput() throws ConditionThrowable
    18331901  {
     
    18451913  }
    18461914
     1915  /** Reads all input from the underlying stream,
     1916   * until _charReady() indicates no more input to be available
     1917   *
     1918   * @throws org.armedbear.lisp.ConditionThrowable
     1919   */
    18471920  public void _clearInput() throws ConditionThrowable
    18481921  {
     
    18661939  }
    18671940
     1941  /** Returns a (non-negative) file position integer or a negative value
     1942   * if the position cannot be determined.
     1943   *
     1944   * @return non-negative value as a position spec
     1945   * @return negative value for 'unspecified'
     1946   * @throws org.armedbear.lisp.ConditionThrowable
     1947   */
    18681948  protected long _getFilePosition() throws ConditionThrowable
    18691949  {
     
    18711951  }
    18721952
     1953  /** Sets the file position based on a position designator passed in arg
     1954   *
     1955   * @param arg File position specifier as described in the CLHS
     1956   * @return true on success, false on failure
     1957   * @throws org.armedbear.lisp.ConditionThrowable
     1958   */
    18731959  protected boolean _setFilePosition(LispObject arg) throws ConditionThrowable
    18741960  {
     
    18761962  }
    18771963
     1964  /** Closes the stream and underlying streams
     1965   *
     1966   * @throws org.armedbear.lisp.ConditionThrowable
     1967   */
    18781968  public void _close() throws ConditionThrowable
    18791969  {
Note: See TracChangeset for help on using the changeset viewer.