本文整理汇总了Java中gnu.mapping.OutPort类的典型用法代码示例。如果您正苦于以下问题:Java OutPort类的具体用法?Java OutPort怎么用?Java OutPort使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OutPort类属于gnu.mapping包,在下文中一共展示了OutPort类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serve
import gnu.mapping.OutPort; //导入依赖的package包/类
/** Run a Kawa repl as a telnet server.
* @param client A client that has connected to us,
* and that wants to use the telnet protocol to talk to a
* Scheme read-eval-print-loop.
*/
public static Thread serve (Language language, java.net.Socket client)
throws java.io.IOException {
Telnet conn = new Telnet(client, true);
java.io.OutputStream sout = conn.getOutputStream();
java.io.InputStream sin = conn.getInputStream();
OutPort out = new OutPort(sout, FilePath.valueOf("/dev/stdout"));
TtyInPort in = new TtyInPort(sin, FilePath.valueOf("/dev/stdin"), out);
// The following was commented out in the original code - markf
/*
conn.request(Telnet.DO, Telnet.EOF);
conn.request(Telnet.DO, Telnet.NAWS);
conn.request(Telnet.DO, Telnet.TTYPE);
conn.request(Telnet.DO, Telnet.LINEMODE);
*/
Thread thread =
new BiggerFuture(new TelnetRepl(language, client),
in, out, out, "Telnet Repl Thread", REPL_STACK_SIZE);
thread.start();
return thread;
}
示例2: format
import gnu.mapping.OutPort; //导入依赖的package包/类
public int format(Object[] args, int start, Writer dst, FieldPosition fpos)
throws java.io.IOException
{
int count = getParam(this.count, 1, args, start);
if (this.count == LispFormat.PARAM_FROM_LIST) start++;
if (count > 0)
{
if (dst instanceof OutPort)
{
((OutPort) dst).freshLine();
count--;
}
while (--count >= 0)
dst.write('\n');
}
return start;
}
示例3: format
import gnu.mapping.OutPort; //导入依赖的package包/类
public int format(Object[] args, int start, Appendable dst, FieldPosition fpos)
throws java.io.IOException
{
int count = getParam(this.count, 1, args, start);
if (this.count == LispFormat.PARAM_FROM_LIST) start++;
if (count > 0)
{
if (dst instanceof OutPort)
{
((OutPort) dst).freshLine();
count--;
}
while (--count >= 0)
dst.append('\n');
}
return start;
}
示例4: run
import gnu.mapping.OutPort; //导入依赖的package包/类
public synchronized void run()
{
for (WriterRef ref = first; ref != null; )
{
WriterRef next = ref.next;
Object port = ref.get();
if (port != null)
{
try
{
((OutPort) port).finalize();
}
catch (Throwable ex)
{
// ignore
}
}
ref = next;
}
first = null;
}
示例5: printNewline
import gnu.mapping.OutPort; //导入依赖的package包/类
public static void printNewline(int kind, Writer dst)
throws java.io.IOException
{
if (dst instanceof OutPort && kind != PrettyWriter.NEWLINE_LITERAL)
((OutPort) dst).writeBreak(kind);
else if (dst instanceof java.io.PrintWriter)
// May make a difference if autoflush. // FIXME flush if OutPort?
((java.io.PrintWriter) dst).println();
else
dst.write(line_separator);
}
示例6: print
import gnu.mapping.OutPort; //导入依赖的package包/类
public void print (OutPort out)
{
out.writeSpaceLinear();
out.startLogicalBlock("(Catch", ")", 2);
out.writeSpaceFill();
decls.printInfo(out);
out.writeSpaceLinear();
body.print(out);
out.endLogicalBlock(")");
}
示例7: printNewline
import gnu.mapping.OutPort; //导入依赖的package包/类
public static void printNewline(int kind, Appendable dst)
throws java.io.IOException
{
if (dst instanceof OutPort && kind != PrettyWriter.NEWLINE_LITERAL)
((OutPort) dst).writeBreak(kind);
else if (dst instanceof java.io.PrintWriter)
// May make a difference if autoflush. // FIXME flush if OutPort?
((java.io.PrintWriter) dst).println();
else
dst.append(line_separator);
}
示例8: register
import gnu.mapping.OutPort; //导入依赖的package包/类
/** Register a Writer.
* @return an object that can be passed to {@link #unregister}.
*/
public synchronized WriterRef register (OutPort port)
{
WriterRef ref = new WriterRef(port);
WriterRef first = this.first; // Copy field to local variable.
if (first != null)
{
ref.next = first;
first.prev = ref;
}
this.first = ref;
return ref;
}
示例9: BiggerFuture
import gnu.mapping.OutPort; //导入依赖的package包/类
public BiggerFuture(Procedure action,
InPort in, OutPort out, OutPort err, String threadName, long stackSize) {
super(new ThreadGroup("biggerthreads"),
new RunnableClosure (action, in, out, err),
threadName, stackSize);
}
示例10: XMLPrinter
import gnu.mapping.OutPort; //导入依赖的package包/类
public XMLPrinter (OutPort out, boolean autoFlush)
{
super(out, autoFlush);
}
示例11: make
import gnu.mapping.OutPort; //导入依赖的package包/类
public static XMLPrinter make(OutPort out, Object style)
{
XMLPrinter xout = new XMLPrinter(out, true);
xout.setStyle(style);
return xout;
}