HelloWorld.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.Tests;
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 java.util.*;
public class HelloWorld extends TestableClosure
{
/**
* @return
*/
public HelloWorld printHello()
{
java.lang.String exitID = "HelloWorld>>printHello";
Frame f0 = new Frame(exitID);
this.log().print(String.from("Hello World!"));
return (HelloWorld)this;
}
/**
* @return
*/
public HelloWorld printWithArgs(final String joinedArgs)
{
java.lang.String exitID = "HelloWorld>>printWithArgs";
Frame f0 = new Frame(exitID);
joinedArgs._isEmpty().ifFalse(Closure.with(f2 -> {
this.log().print((String.from(" with ").append(joinedArgs)));
}, ""));
return (HelloWorld)this;
}
/**
* @return
*/
@Override public void runTest()
{
java.lang.String exitID = "HelloWorld>>runTest";
Frame f0 = new Frame(exitID);
this.runWithArgs(String.listWithEach(this.arguments()));
}
/**
* @return
*/
public void runWithArgs(final List<String> args)
{
java.lang.String exitID = "HelloWorld>>runWithArgs";
Frame f0 = new Frame(exitID);
String joinedArgs = String.join_with(args, String.from(" "));
this.printHello();
this.printWithArgs(joinedArgs);
this.log().cr();
}
}