package test.beaker;
import java.util.Date;
import java.text.SimpleDateFormat;
public class BeakerTest {
private Date _date;
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ");
public BeakerTest() {
_date = new Date();
}
public String getDateTxt() {
return "Today:" + sdf.format(_date);
}
public String getDateUpperCaseTxt() {
return getDateTxt().toUpperCase();
}
}
package test.beaker;
BeakerTest bt = new BeakerTest();
return bt.getDateTxt();
import java.util.List;
import java.util.ArrayList;
import com.twosigma.beakerx.chart.xychart.Plot;
import com.twosigma.beakerx.chart.xychart.plotitem.*;
import com.twosigma.beakerx.chart.Color;
Plot p = new Plot();
p.setTitle("this is a Java plot");
Bars b = new Bars();
List<Number> yList = new ArrayList<Number>();
yList.add(2);
yList.add(5);
yList.add(4);
yList.add(8);
b.setY(yList);
b.setColor(Color.blue);
b.setWidth(0.5);
p.add(b);
return p;
package test.beaker;
interface DateGetter {
public String getDateTxt();
}
package test.beaker;
public class DG2 extends BeakerTest implements DateGetter {
}
%classpath add jar ../../../doc/resources/jar/BeakerXClasspathTest.jar
System.out.println("The Groovy working folder is :");
System.out.println(java.nio.file.Paths.get(".").toAbsolutePath().normalize().toString());
System.out.println("BeakerXClasspathTest.jar exists in this folder");
import com.beaker.BeakerXClasspathTest;
BeakerXClasspathTest t = new BeakerXClasspathTest();
System.out.println(com.beaker.BeakerXClasspathTest.staticTest);
System.out.println(t.getObjectTest());
press 'Tab' for autocomplete
press 'Shift' + 'Tab' for doc
import com.twosigma.beakerx.widget.Output;
Output out2 = new Output();
OutputManager.setOutput(out2);
return out2;
import static java.lang.System.out;
Thread t = new Thread(() -> {
out.println("Some output init");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
for (int i = 0; i <10 ; i++){
out.println("Some output "+ i);
}
});
out.println("Start");
t.start();
//t.join();
out.println("end");
return "Thread example result";
OutputManager.clearOutput();
import static java.lang.System.out;
for (int i = 0; i <30 ; i++){
out.println("Done "+ i);
}
return 3+5;
OutputManager.setOutput(null);