TextWriteStream.java
/**
* Copyright 2010,2021 Nikolas S Boyd.
Permission is granted to copy this work provided this copyright statement is retained in all copies.
*/
package Hoot.Streams;
import Hoot.Runtime.Functions.*;
import Hoot.Runtime.Faces.*;
import Hoot.Runtime.Values.*;
import Hoot.Runtime.Blocks.*;
import Smalltalk.Core.*;
import Smalltalk.Blocks.*;
import Smalltalk.Magnitudes.*;
import Hoot.Behaviors.*;
import Hoot.Behaviors.Nil;
import Hoot.Behaviors.Object;
import Hoot.Behaviors.True;
import Hoot.Behaviors.False;
import Hoot.Behaviors.Boolean;
import Hoot.Magnitudes.*;
import Hoot.Magnitudes.Integer;
import Hoot.Magnitudes.Character;
import Hoot.Magnitudes.Float;
import Hoot.Magnitudes.Double;
import Hoot.Collections.*;
import Hoot.Collections.String;
import Smalltalk.Magnitudes.Code;
import Smalltalk.Collections.*;
public class TextWriteStream extends WriteStream<Character>
{
public static Metaclass type() { return (Metaclass)Metaclass.$class; }
@Override public Metaclass $class() { return (Metaclass)Metaclass.$class; }
public static class Metaclass extends WriteStream.Metaclass
{
static final TextWriteStream.Metaclass $class = new TextWriteStream.Metaclass();
public Metaclass() {
this(TextWriteStream.Metaclass.class);
}
public Metaclass(java.lang.Class aClass) {
super(aClass);
}
@Override public java.lang.Class outerClass() { return TextWriteStream.class; }
/**
* @return
*/
@Override public TextWriteStream with(final CollectedVariably aString)
{
java.lang.String exitID = "TextWriteStreamMetatype>>with";
Frame f0 = new Frame(exitID);
return f0.evaluate(() -> {
return (TextWriteStream)f0.exit(exitID, this.with(((String)aString)));
});
}
/**
* @return
*/
public TextWriteStream with(final String aString)
{
java.lang.String exitID = "TextWriteStreamMetatype>>with";
Frame f0 = new Frame(exitID);
return f0.evaluate(() -> {
return (TextWriteStream)f0.exit(exitID, new TextWriteStream(aString));
});
}
}
/**
*
*/
protected TextWriteStream(final String aString)
{
super(aString);
java.lang.String exitID = "TextWriteStream>>TextWriteStream";
Frame f0 = new Frame(exitID);
}
/**
* @return
*/
@Override public String contents()
{
java.lang.String exitID = "TextWriteStream>>contents";
Frame f0 = new Frame(exitID);
return (String)String.from(contents.toString());
}
/**
* @return
*/
public TextWriteStream nextPut(final Character element)
{
java.lang.String exitID = "TextWriteStream>>nextPut";
Frame f0 = new Frame(exitID);
((String)contents).add(element);
position = (SmallInteger.from(1).plus(position));
return (TextWriteStream)this;
}
/**
* @return
*/
@Override public TextWriteStream nextPutAll(final CollectedReadably<Character> elements)
{
java.lang.String exitID = "TextWriteStream>>nextPutAll";
Frame f0 = new Frame(exitID);
((String)contents).addAll(elements);
position = (position.plus(elements.size()));
return (TextWriteStream)this;
}
}