<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.jstacs.de/index.php?action=history&amp;feed=atom&amp;title=Intermediate_course%3A_XMLParser%2C_Parameters%2C_and_Results</id>
	<title>Intermediate course: XMLParser, Parameters, and Results - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.jstacs.de/index.php?action=history&amp;feed=atom&amp;title=Intermediate_course%3A_XMLParser%2C_Parameters%2C_and_Results"/>
	<link rel="alternate" type="text/html" href="https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;action=history"/>
	<updated>2026-04-04T16:07:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;diff=538&amp;oldid=prev</id>
		<title>Grau at 08:42, 3 February 2012</title>
		<link rel="alternate" type="text/html" href="https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;diff=538&amp;oldid=prev"/>
		<updated>2012-02-03T08:42:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:42, 3 February 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Finally, the same problem also occurrs for the results of computations. With a generic documentation, these results can be displayed together with some annotation in a way that is appropriate for the current application. In Jstacs, we use [http://www.jstacs.de/api-2.0//de/jstacs/results/Result.html Result] s and [http://www.jstacs.de/api-2.0//de/jstacs/results/ResultSet.html ResultSet] s for this purpose, and we show how to use these in the third sub-section.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Finally, the same problem also occurrs for the results of computations. With a generic documentation, these results can be displayed together with some annotation in a way that is appropriate for the current application. In Jstacs, we use [http://www.jstacs.de/api-2.0//de/jstacs/results/Result.html Result] s and [http://www.jstacs.de/api-2.0//de/jstacs/results/ResultSet.html ResultSet] s for this purpose, and we show how to use these in the third sub-section.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;__TOC__&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== XMLParser ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== XMLParser ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Grau</name></author>
	</entry>
	<entry>
		<id>https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;diff=522&amp;oldid=prev</id>
		<title>Grau at 14:25, 2 February 2012</title>
		<link rel="alternate" type="text/html" href="https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;diff=522&amp;oldid=prev"/>
		<updated>2012-02-02T14:25:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:25, 2 February 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Intermediate course: XMLParser, Parameters, and Results =&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span id=&amp;quot;sec:xmlparres&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span id=&amp;quot;sec:xmlparres&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Grau</name></author>
	</entry>
	<entry>
		<id>https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;diff=510&amp;oldid=prev</id>
		<title>Grau at 14:00, 2 February 2012</title>
		<link rel="alternate" type="text/html" href="https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;diff=510&amp;oldid=prev"/>
		<updated>2012-02-02T14:00:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;amp;diff=510&amp;amp;oldid=489&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Grau</name></author>
	</entry>
	<entry>
		<id>https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;diff=489&amp;oldid=prev</id>
		<title>Grau: Created page with &quot;&lt;span id=&quot;sec:xmlparres&quot;&gt; &lt;/span&gt;  In the early days of Jstacs, we stored models, classifiers, and other Jstacs objects using the standard serialization of Java. However, this me...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.jstacs.de/index.php?title=Intermediate_course:_XMLParser,_Parameters,_and_Results&amp;diff=489&amp;oldid=prev"/>
		<updated>2012-02-01T22:51:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;span id=&amp;quot;sec:xmlparres&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;  In the early days of Jstacs, we stored models, classifiers, and other Jstacs objects using the standard serialization of Java. However, this me...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;span id=&amp;quot;sec:xmlparres&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the early days of Jstacs, we stored models, classifiers, and other Jstacs objects using the standard serialization of Java. However, this mechanism made it impossible to load objects of earlier versions of a class and the files where not human-readable. Hence, we started to create a facility for storing objects to XML representations. In the current version of Jstacs, this is accomplished by an interface [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] for objects that can be converted to and from their XML representation, and a class [http://www.jstacs.de/api-2.0//de/jstacs/io/XMLParser.html XMLParser] that can handle such [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] s, [http://www.jstacs.de/api-2.0//de/jstacs//Singleton.html Singleton] s, Strings, Classes, primitives, and arrays thereof. In the first sub-section, we give examples how to use the [http://www.jstacs.de/api-2.0//de/jstacs/io/XMLParser.html XMLParser].&lt;br /&gt;
&lt;br /&gt;
Another problem we wanted to handle has been the documentation of (external) parameters of models, classifiers, or other classes. Although documentation exists in the Javadocs, these are inaccessible from the code. Hence, we created classes for the documentation of parameters and sets of parameters, namely the subclasses of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/Parameter.html Parameter] and [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet]. A [http://www.jstacs.de/api-2.0//de/jstacs/parameters/Parameter.html Parameter] at least provides the name of and a comment on the parameter that is described. In sub-classes, other values are also available like, for instance, the set or a range of allowed values. Such a description of parameters allows for manifold generic convenience applications. Current examples are the [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSetTagger.html ParameterSetTagger], which facilitates the documentation of command line arguments on basis of a [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet], or the [http://www.jstacs.de/api-2.0//de/jstacs/utils/galaxy/GalaxyAdaptor.html GalaxyAdaptor], which allows for an easy integration of Jstacs applications into the Galaxy webserver. We give examples for the use and creation of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/Parameter.html Parameter] s and [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] s in the second sub-section.&lt;br /&gt;
&lt;br /&gt;
Finally, the same problem also occurrs for the results of computations. With a generic documentation, these results can be displayed together with some annotation in a way that is appropriate for the current application. In Jstacs, we use [http://www.jstacs.de/api-2.0//de/jstacs/results/Result.html Result] s and [http://www.jstacs.de/api-2.0//de/jstacs/results/ResultSet.html ResultSet] s for this purpose, and we show how to use these in the third sub-section.&lt;br /&gt;
&lt;br /&gt;
== XMLParser ==&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:xmlparser&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
In the following examples, let &amp;lt;code&amp;gt;buffer&amp;lt;/code&amp;gt; be some &amp;lt;code&amp;gt;StringBuffer&amp;lt;/code&amp;gt;. &lt;br /&gt;
All kinds of primitives or [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] s are appended to an existing &amp;lt;code&amp;gt;StringBuffer&amp;lt;/code&amp;gt; surrounded by the specified XML tags by the static method &amp;lt;code&amp;gt;appendObjectWithTags&amp;lt;/code&amp;gt; of [http://www.jstacs.de/api-2.0//de/jstacs/io/XMLParser.html XMLParser]. For example, the following two lines append an integer with the value &amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt; using the tag &amp;lt;code&amp;gt;integer&amp;lt;/code&amp;gt;, and a &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt; with the tag &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		int integer = 5;&lt;br /&gt;
		XMLParser.appendObjectWithTags( buffer, integer, &amp;quot;integer&amp;quot; );&lt;br /&gt;
		String bar = &amp;quot;hello world&amp;quot;;&lt;br /&gt;
		XMLParser.appendObjectWithTags( buffer, bar, &amp;quot;foo&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we assume that &amp;lt;code&amp;gt;buffer&amp;lt;/code&amp;gt; was an empty &amp;lt;code&amp;gt;StringBuffer&amp;lt;/code&amp;gt; before appending these two elements, the resulting XML text will be&lt;br /&gt;
&amp;lt;source lang=&amp;quot;XML&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;integer&amp;gt;&amp;lt;className&amp;gt;java.lang.Integer&amp;lt;/className&amp;gt;5&amp;lt;/integer&amp;gt;&lt;br /&gt;
&amp;lt;foo&amp;gt;&amp;lt;className&amp;gt;java.lang.String&amp;lt;/className&amp;gt;hello world&amp;lt;/foo&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In exactly the same manner, we can append XML representations of arrays of primitives, for example a two-dimensional array of &amp;lt;code&amp;gt;double&amp;lt;/code&amp;gt; s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		double[][] da = new double[4][6];&lt;br /&gt;
		XMLParser.appendObjectWithTags( buffer, da, &amp;quot;da&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or complete Jstacs models that implement the [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		HomogeneousMM hMM = new HomogeneousMM( new HomMMParameterSet( DNAAlphabetContainer.SINGLETON, 4, &amp;quot;hmm(0)&amp;quot;, (byte) 0 ) );&lt;br /&gt;
		XMLParser.appendObjectWithTags( buffer, hMM, &amp;quot;hMM&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or even arrays of [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] s:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		Storable[] storAr = ArrayHandler.createArrayOf( hMM, 5 );&lt;br /&gt;
		XMLParser.appendObjectWithTags( buffer, storAr, &amp;quot;storAr&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The interface [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] only defines two things: first, an implementing class must provide a public method &amp;lt;code&amp;gt;toXML()&amp;lt;/code&amp;gt; that returns the XML representation of this class as a &amp;lt;code&amp;gt;StringBuffer&amp;lt;/code&amp;gt;, and second, it must provide a constructor that takes a single &amp;lt;code&amp;gt;StringBuffer&amp;lt;/code&amp;gt; as its argument and re-creates an object out of this representation. The only exception from this rule are singletons, i.e., classes that implement the [http://www.jstacs.de/api-2.0//de/jstacs//Singleton.html Singleton] interface.&lt;br /&gt;
&lt;br /&gt;
Of course, you can use the &amp;lt;code&amp;gt;appendObjectWithTags&amp;lt;/code&amp;gt; method of the [http://www.jstacs.de/api-2.0//de/jstacs/io/XMLParser.html XMLParser] inside the &amp;lt;code&amp;gt;toXML&amp;lt;/code&amp;gt; method. By this means, it is possible to break down the conversion of complex models into smaller pieces if the building-blocks of a model are also [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] s.&lt;br /&gt;
&lt;br /&gt;
In analogy to storing objects, the [http://www.jstacs.de/api-2.0//de/jstacs/io/XMLParser.html XMLParser] also provides facilities for loading primitives and [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] s from their XML representation. These can also be used in the constructor according to the [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] interface. For example, we can load the value of the integer, we stored a few lines ago by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		integer = (Integer) XMLParser.extractObjectForTags( buffer, &amp;quot;integer&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the second argument of &amp;lt;code&amp;gt;extractObjectForTags&amp;lt;/code&amp;gt; is the tag surrounding the value and, of course, must be identical to the tag we specified when storing the value. Since &amp;lt;code&amp;gt;extractObjectForTags&amp;lt;/code&amp;gt; is a generic method, we must explicitly cast the returned value to an &amp;lt;code&amp;gt;Integer&amp;lt;/code&amp;gt;. As an alternative, we can also specify the class of the return type as a third argument like in the following example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		da = XMLParser.extractObjectForTags( buffer, &amp;quot;da&amp;quot;, double[][].class );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, we load the two-dimensional array of &amp;lt;code&amp;gt;double&amp;lt;/code&amp;gt;s that we stored a few lines ago.&lt;br /&gt;
In perfect analogy, we can also load a single instance of a class implementing [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		hMM = XMLParser.extractObjectForTags( buffer, &amp;quot;hMM&amp;quot;, HomogeneousMM.class );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where in this case we again specify the class of the return type in the third argument, or arrays of [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		storAr = (Storable[]) XMLParser.extractObjectForTags( buffer, &amp;quot;storAr&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Of course, we can also specify the concrete sub-class of [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] for an array, if all instances are of the same class like in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		HomogeneousMM[] hmAr = ArrayHandler.createArrayOf( hMM, 5 );&lt;br /&gt;
		XMLParser.appendObjectWithTags( buffer, hmAr, &amp;quot;hmAr&amp;quot; );&lt;br /&gt;
		hmAr = (HomogeneousMM[]) XMLParser.extractObjectForTags( buffer, &amp;quot;hmAr&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Parameters &amp;amp; ParameterSets ==&lt;br /&gt;
&lt;br /&gt;
Parameters in Jstacs are represented by different sub-classes of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/Parameter.html Parameter], which define different types of parameters. Parameters that take primitives or strings as values are defined by the class [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SimpleParameter.html SimpleParameter], parameters that accept values from some &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; type are defined by [http://www.jstacs.de/api-2.0//de/jstacs/parameters/EnumParameter.html EnumParameter], parameters where the user can select from a number of predefined values are defined by [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SelectionParameter.html SelectionParameter], parameters that represent a file argument are defined by [http://www.jstacs.de/api-2.0//de/jstacs/parameters/FileParameter.html FileParameter], and parameters that represent a range of values are represented by [http://www.jstacs.de/api-2.0//de/jstacs/parameters/RangeParameter.html RangeParameter].&lt;br /&gt;
In the following, we give some examples for the creation of parameter objects. Let us assume, we want to define a parameter for the length of the sequences accepted by some model. The maximum sequence length this model can handle is &amp;lt;math&amp;gt;100&amp;lt;/math&amp;gt; and, of course, lengths cannot be negative. We create such a parameter object by the following lines of code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		SimpleParameter simplePar = new SimpleParameter( DataType.INT, &amp;quot;Sequence length&amp;quot;, &amp;quot;The required length of a sequence&amp;quot;, true, new NumberValidator&amp;lt;Integer&amp;gt;( 1, 100 ), 10 );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first argument of the constructor defines the data type of the accepted values, which is an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; in the example. The next two arguments are the name of and the comment for the parameter. The following boolean specifies if this parameter is required (&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;) or optional (&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;). The [http://www.jstacs.de/api-2.0//de/jstacs/parameters/validation/NumberValidator.html NumberValidator] in the fifth argument allows for specifying the range of allowed values, which is &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;100&amp;lt;/math&amp;gt; (inclusive) in the example. Finally, we define a default value for this parameter, which is &amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt; in the example.&lt;br /&gt;
Similarly, we can define a [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SimpleParameter.html SimpleParameter] †for some optional parameter that takes strings as values by the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		SimpleParameter simplePar2 = new SimpleParameter( DataType.STRING, &amp;quot;Name&amp;quot;, &amp;quot;The name of the game&amp;quot;, false );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the second and third arguments are the name and the comment, respectively.&lt;br /&gt;
&lt;br /&gt;
We can define an [http://www.jstacs.de/api-2.0//de/jstacs/parameters/EnumParameter.html EnumParameter], which accept values from some &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; type as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		EnumParameter enumpar = new EnumParameter( DataType.class, &amp;quot;Data types&amp;quot;, true );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the first argument defines the class of the &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; type, the second is the name of that collection of values, and the third argument again specifies if this parameter is required.&lt;br /&gt;
&lt;br /&gt;
A [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SelectionParameter.html SelectionParameter] accepts values from a pre-defined collection of values. For instance, if we want the user to select from two double values &amp;lt;math&amp;gt;5.0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;5E6&amp;lt;/math&amp;gt;, which are named &amp;amp;quot;small&amp;amp;quot; and &amp;amp;quot;large&amp;amp;quot;, we can do so as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		SelectionParameter collPar = new SelectionParameter( DataType.DOUBLE, new String[]{&amp;quot;small&amp;quot;, &amp;quot;large&amp;quot;}, new Double[]{5.0,5E6}, &amp;quot;Numbers&amp;quot;, &amp;quot;A selection of numbers&amp;quot;, true );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the special case, where the user shall select the concrete implementation of an abstract class of interface, Jstacs provides a static convenience method &amp;lt;code&amp;gt;getSelectionParameter&amp;lt;/code&amp;gt; in the class [http://www.jstacs.de/api-2.0//de/jstacs/utils/SubclassFinder.html SubclassFinder]. This method requires the specification of the super-class of the [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] that can be used to instantiate the implementations, the root package in which sub-classes or implementations shall be found, and, again, a name, a comment, and if this parameter is required.&lt;br /&gt;
For example, we can find all classes that can be instantiated by a sub-class of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SequenceScoringParameterSet.html SequenceScoringParameterSet] the package &amp;lt;code&amp;gt;de&amp;lt;/code&amp;gt; and its sub-packages by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		collPar = SubclassFinder.getSelectionParameter( SequenceScoringParameterSet.class, &amp;quot;de&amp;quot;, &amp;quot;Sequence scores&amp;quot;, &amp;quot;All Sequence scores in Jstacs that can be created from parameter sets&amp;quot;, true );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method returns a [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SelectionParameter.html SelectionParameter] from which a user can select the appropriate implementation.&lt;br /&gt;
Classes that can be found in this manner must implement an additional interface called [http://www.jstacs.de/api-2.0//de/jstacs//InstantiableFromParameterSet.html InstantiableFromParameterSet]. The main purpose of this interface is that implementing classes must provide a constructor that takes a [http://www.jstacs.de/api-2.0//de/jstacs/parameters/InstanceParameterSet.html InstanceParameterSet] as its only argument in analogy to the constructor of [http://www.jstacs.de/api-2.0//de/jstacs//Storable.html Storable] working on a &amp;lt;code&amp;gt;StringBuffer&amp;lt;/code&amp;gt;. [http://www.jstacs.de/api-2.0//de/jstacs/parameters/InstanceParameterSet.html InstanceParameterSet] s will be explained a few lines below.&lt;br /&gt;
&lt;br /&gt;
As the name suggests, [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] s represent sets of such parameters. The most simple implementation of a [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] is the [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SimpleParameterSet.html SimpleParameterSet], which can be created just from a number of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/Parameter.html Parameter] s like in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		SimpleParameterSet parSet = new SimpleParameterSet( simplePar,collPar );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] s are the [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ExpandableParameterSet.html ExpandableParameterSet] and [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ArrayParameterSet.html ArrayParameterSet], which can handle series of identical parameter types.&lt;br /&gt;
&lt;br /&gt;
One special case of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] s is the [http://www.jstacs.de/api-2.0//de/jstacs/parameters/InstanceParameterSet.html InstanceParameterSet], which has several sub-classes that can be used to instantiate new Jstacs objects like statistical models or classifiers. If a new model, say an implementation of the [http://www.jstacs.de/api-2.0//de/jstacs/sequenceScores/statisticalModels/trainable/TrainableStatisticalModel.html TrainableStatisticalModel] interface, shall be found via the [http://www.jstacs.de/api-2.0//de/jstacs/utils/SubclassFinder.html SubclassFinder], or its parameters shall be set in a command line program using the [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSetTagger.html ParameterSetTagger] or in Galaxy, we need to create a new sub-class of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/InstanceParameterSet.html InstanceParameterSet] that represents all (external) parameters of this model. In this sub-class we must basically implement two methods: &amp;lt;code&amp;gt;getInstanceName&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;getInstanceComment&amp;lt;/code&amp;gt; return the name of and a comment on the model class (i.e., in the example, the model we just implemented) that may be of help for a potential user. The constructor does the main work. By a call to the super-constructor, it initializes the list of parameters in this set and then adds the parameters of the model.&lt;br /&gt;
&lt;br /&gt;
%&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		};&lt;br /&gt;
		&lt;br /&gt;
		//parameter set container&lt;br /&gt;
		ParameterSetContainer container = new ParameterSetContainer( &amp;quot;Set&amp;quot;, &amp;quot;A set of parameters&amp;quot;, parSet );&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	public static void results() throws Exception {&lt;br /&gt;
		&lt;br /&gt;
		//create numerical result&lt;br /&gt;
		NumericalResult res = new NumericalResult( &amp;quot;A double result&amp;quot;, &amp;quot;This result contains some double value&amp;quot;, 5.0 );&lt;br /&gt;
		&lt;br /&gt;
		//create categorical result&lt;br /&gt;
		CategoricalResult catRes = new CategoricalResult( &amp;quot;A boolean result&amp;quot;, &amp;quot;This result contains some boolean&amp;quot;, true );&lt;br /&gt;
		&lt;br /&gt;
		//create result set&lt;br /&gt;
		ResultSet resSet = new ResultSet( new Result[]{res,catRes} );&lt;br /&gt;
		&lt;br /&gt;
		//create and fill mean result set&lt;br /&gt;
		MeanResultSet mrs = new MeanResultSet();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For implementations of the [http://www.jstacs.de/api-2.0//de/jstacs/sequenceScores/statisticalModels/trainable/TrainableStatisticalModel.html TrainableStatisticalModel] interface we may also extend [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SequenceScoringParameterSet.html SequenceScoringParameterSet], which already handles the [http://www.jstacs.de/api-2.0//de/jstacs/data/AlphabetContainer.html AlphabetContainer] and length of this model.&lt;br /&gt;
&lt;br /&gt;
Not always do we have flat hierarchies of parameters. For instance, the choice of subsequent parameters may depend on the selection from some [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SelectionParameter.html SelectionParameter]. For this purpose, Jstacs provides a sub-class of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/Parameter.html Parameter] that only serves as a container for a [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] and is called [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSetContainer.html ParameterSetContainer]. Like other parameters, this container takes a name and a comment in its constructor, whereas the third argument is a [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		ParameterSetContainer container = new ParameterSetContainer( &amp;quot;Set&amp;quot;, &amp;quot;A set of parameters&amp;quot;, parSet );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since such a [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSetContainer.html ParameterSetContainer] can itself be part of another [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet], we can build hierarchies or trees of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/Parameter.html Parameter] s and [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] s. [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSetContainer.html ParameterSetContainer]s are also used internally to create [http://www.jstacs.de/api-2.0//de/jstacs/parameters/SelectionParameter.html SelectionParameter] s from an array of [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] s, e.g., for &amp;lt;code&amp;gt;getSelectionParameter&amp;lt;/code&amp;gt; in the [http://www.jstacs.de/api-2.0//de/jstacs/utils/SubclassFinder.html SubclassFinder].&lt;br /&gt;
&lt;br /&gt;
== Results &amp;amp; ResultSets ==&lt;br /&gt;
&lt;br /&gt;
In Jstacs, several types of [http://www.jstacs.de/api-2.0//de/jstacs/results/Result.html Result] s are implemented. The two basic [http://www.jstacs.de/api-2.0//de/jstacs/results/Result.html Result] types are [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResult.html NumericalResult] s and [http://www.jstacs.de/api-2.0//de/jstacs/results/CategoricalResult.html CategoricalResult] s. The first are results containing numerical values, which can be aggregated, for instance averaged, while the latter are results of categorical values like strings or booleans. &lt;br /&gt;
For example, we can create a [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResult.html NumericalResult] containing a single &amp;lt;code&amp;gt;double&amp;lt;/code&amp;gt; value by the following line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		NumericalResult res = new NumericalResult( &amp;quot;A double result&amp;quot;, &amp;quot;This result contains some double value&amp;quot;, 5.0 );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where, in analogy to [http://www.jstacs.de/api-2.0//de/jstacs/parameters/Parameter.html Parameter] s, the first and the second argument are the name of and a comment on the result, respectively.&lt;br /&gt;
&lt;br /&gt;
Similarly, we create a [http://www.jstacs.de/api-2.0//de/jstacs/results/CategoricalResult.html CategoricalResult] by the following line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		CategoricalResult catRes = new CategoricalResult( &amp;quot;A boolean result&amp;quot;, &amp;quot;This result contains some boolean&amp;quot;, true );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for a result that is a single &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; value.&lt;br /&gt;
&lt;br /&gt;
As for [http://www.jstacs.de/api-2.0//de/jstacs/parameters/ParameterSet.html ParameterSet] s, we can create sets of results using the class [http://www.jstacs.de/api-2.0//de/jstacs/results/ResultSet.html ResultSet]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		ResultSet resSet = new ResultSet( new Result[]{res,catRes} );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where we may also combine [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResult.html NumericalResult] s and [http://www.jstacs.de/api-2.0//de/jstacs/results/CategoricalResult.html CategoricalResult] s into a single set. Besides simple [http://www.jstacs.de/api-2.0//de/jstacs/results/ResultSet.html ResultSet] s, Jstacs comprises&lt;br /&gt;
[http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResultSet.html NumericalResultSet] s for combining only [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResult.html NumericalResult] s, which can be created in complete analogy to [http://www.jstacs.de/api-2.0//de/jstacs/results/ResultSet.html ResultSet] s.&lt;br /&gt;
&lt;br /&gt;
Jstacs also provides a special class for averaging [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResult.html NumericalResult]. &lt;br /&gt;
This class is called [http://www.jstacs.de/api-2.0//de/jstacs/results/MeanResultSet.html MeanResultSet], and computes the average and standard error of the corresponding values of a number of [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResultSet.html NumericalResultSet] s. The corresponding [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResult.html NumericalResult] s in the [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResultSet.html NumericalResultSet] are identified by their name as specified upon creation.&lt;br /&gt;
&lt;br /&gt;
We first create an empty [http://www.jstacs.de/api-2.0//de/jstacs/results/MeanResultSet.html MeanResultSet] by calling its default constructor&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		MeanResultSet mrs = new MeanResultSet();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and subsequently add a number of [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResultSet.html NumericalResultSet] s to this [http://www.jstacs.de/api-2.0//de/jstacs/results/MeanResultSet.html MeanResultSet].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		Random r = new Random();&lt;br /&gt;
		for(int i=0;i&amp;lt;10;i++){&lt;br /&gt;
			mrs.addResults( new NumericalResultSet( new NumericalResult( &amp;quot;Single&amp;quot;, &amp;quot;A single result to be aggregated&amp;quot;, r.nextDouble() ) ) );&lt;br /&gt;
		}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, these are just 10 uniformly distributed random numbers.&lt;br /&gt;
&lt;br /&gt;
Finally, we call the method &amp;lt;code&amp;gt;getStatistics&amp;lt;/code&amp;gt; of [http://www.jstacs.de/api-2.0//de/jstacs/results/MeanResultSet.html MeanResultSet] to obtain the mean and standard error of the previously added values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java5&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		System.out.println( mrs.getStatistics() );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the result of this method is again returned as a [http://www.jstacs.de/api-2.0//de/jstacs/results/NumericalResultSet.html NumericalResultSet]. In the example, it is just printed to standard out.&lt;/div&gt;</summary>
		<author><name>Grau</name></author>
	</entry>
</feed>