01: package sisc.data;
02:
03: import java.io.IOException;
04: import java.io.Reader;
05:
06: import sisc.data.NamedValue;
07: import sisc.io.InputPort;
08: import sisc.io.ValueWriter;
09:
10: /**
11: * A Scheme character output port.
12: *
13: * Character output ports are wrappers around Java's Readers.
14: */
15: public class SchemeCharacterInputPort extends Value implements
16: InputPort, NamedValue {
17:
18: protected Reader reader;
19:
20: public SchemeCharacterInputPort(Reader r) {
21: reader = r;
22: }
23:
24: public Reader getReader() {
25: return reader;
26: }
27:
28: public void display(ValueWriter w) throws IOException {
29: displayNamedOpaque(w, "character-input-port");
30: }
31:
32: public void close() throws IOException {
33: reader.close();
34: }
35:
36: public boolean ready() throws IOException {
37: return reader.ready();
38: }
39: }
40: /*
41: * The contents of this file are subject to the Mozilla Public
42: * License Version 1.1 (the "License"); you may not use this file
43: * except in compliance with the License. You may obtain a copy of
44: * the License at http://www.mozilla.org/MPL/
45: *
46: * Software distributed under the License is distributed on an "AS
47: * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
48: * implied. See the License for the specific language governing
49: * rights and limitations under the License.
50: *
51: * The Original Code is the Second Interpreter of Scheme Code (SISC).
52: *
53: * The Initial Developer of the Original Code is Scott G. Miller.
54: * Portions created by Scott G. Miller are Copyright (C) 2000-2007
55: * Scott G. Miller. All Rights Reserved.
56: *
57: * Contributor(s):
58: * Matthias Radestock
59: *
60: * Alternatively, the contents of this file may be used under the
61: * terms of the GNU General Public License Version 2 or later (the
62: * "GPL"), in which case the provisions of the GPL are applicable
63: * instead of those above. If you wish to allow use of your
64: * version of this file only under the terms of the GPL and not to
65: * allow others to use your version of this file under the MPL,
66: * indicate your decision by deleting the provisions above and
67: * replace them with the notice and other provisions required by
68: * the GPL. If you do not delete the provisions above, a recipient
69: * may use your version of this file under either the MPL or the
70: * GPL.
71: */
|