User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:10_rgg_addition:04_operator_overload:printer

PrintWriter

The PrintWriter(java.io.PrintWriter) objects can easily get content added with the overload operator shl

SHL

  • PrintWriter << Object print the object.
  • PrintWriter << primitive print the primitive.
 
module A(float len, float fact);
protected void init ()
[
	Axiom ==> A(2,5) A(5,1) A(1,1);
]
public void run ()
{
 
java.io.PrintWriter output = new java.io.PrintWriter("/home/tim/pwTest.txt");
 
 output << (*a:A*).getId() << "," << a[len] << "," << a[fact] << "," << a[len]*a[fact] << "\n";
output.close();
}

Or it can be used with the out object, a static PrintWriter that represents the XL console. In this case out << "test" is the same as print("test");

01_user_documentation/07_rgg_xl/02_xl/10_rgg_addition/04_operator_overload/printer.txt · Last modified: 2026/03/27 17:39 by Tim