de.jstacs.results
Class ListResult

java.lang.Object
  extended by de.jstacs.AnnotatedEntity
      extended by de.jstacs.results.Result
          extended by de.jstacs.results.ListResult
All Implemented Interfaces:
Storable

public class ListResult
extends Result

Class for a Result that contains a list or a matrix, respectively, of ResultSets. This class provides a way to build a hierarchy of Results and ResultSets, or to create multi-dimensional Result.

Author:
Jan Grau, Jens Keilwagen

Field Summary
protected  ResultSet[] list
          The internal list of ResultSets that are part of this ListResult
 
Fields inherited from class de.jstacs.AnnotatedEntity
comment, datatype, name
 
Constructor Summary
ListResult(StringBuffer representation)
          The standard constructor for the interface Storable.
ListResult(String name, String comment, ResultSet annotation, ResultSet... results)
          Creates a new ListResult from an array of ResultSets and a ResultSet of annotations, which may provide additional information on this ListResult.
 
Method Summary
protected  void appendFurtherInfos(StringBuffer buf)
          This method can be used in the method Storable.toXML() to extract further information (name, comment, datatype).
protected  void extractFurtherInfos(StringBuffer representation)
          This method can be used in the constructor with parameter StringBuffer to extract the further information.
 ResultSet getAnnotation()
          Returns a reference to the annotation of this ListResult.
 ResultSet[] getRawResult()
          Returns a copy of the internal list of ResultSets.
 ResultSet[] getValue()
          Returns the value of the AnnotatedEntity.
 String getXMLTag()
          This method returns a tag used as outer tag of the XML description.
 void print(PrintWriter writer)
          Prints the information of this ListResult to the provided PrintWriter.
 ListResult sort(String columnName)
          This method enables you to sort the entries of this container by a specified column.
 String toString()
           
 
Methods inherited from class de.jstacs.results.Result
checkDatatype, createResult, isCastableResult, isComparableResult
 
Methods inherited from class de.jstacs.AnnotatedEntity
getComment, getDatatype, getName, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected ResultSet[] list
The internal list of ResultSets that are part of this ListResult

Constructor Detail

ListResult

public ListResult(String name,
                  String comment,
                  ResultSet annotation,
                  ResultSet... results)
Creates a new ListResult from an array of ResultSets and a ResultSet of annotations, which may provide additional information on this ListResult.

Parameters:
name - the name of the ListResult
comment - the comment on the ListResult
annotation - an annotation on this ListResult
results - the array of ResultSets

ListResult

public ListResult(StringBuffer representation)
           throws NonParsableException
The standard constructor for the interface Storable. Creates a new ListResult from the corresponding XML representation.

Parameters:
representation - the XML representation as StringBuffer
Throws:
NonParsableException - if the StringBufferrepresentation could not be parsed
Method Detail

getValue

public ResultSet[] getValue()
Description copied from class: AnnotatedEntity
Returns the value of the AnnotatedEntity.

Specified by:
getValue in class AnnotatedEntity
Returns:
the value of the AnnotatedEntity

getRawResult

public ResultSet[] getRawResult()
Returns a copy of the internal list of ResultSets. The references to the ResultSets in the array are not cloned.

Returns:
the internal list of ResultSets

getAnnotation

public ResultSet getAnnotation()
Returns a reference to the annotation of this ListResult.

Returns:
the annotation of this ListResult

getXMLTag

public String getXMLTag()
Description copied from class: AnnotatedEntity
This method returns a tag used as outer tag of the XML description.

Specified by:
getXMLTag in class AnnotatedEntity
Returns:
a tag used as outer tag of the XML description

appendFurtherInfos

protected void appendFurtherInfos(StringBuffer buf)
Description copied from class: AnnotatedEntity
This method can be used in the method Storable.toXML() to extract further information (name, comment, datatype).

Specified by:
appendFurtherInfos in class AnnotatedEntity
Parameters:
buf - a XML representation of the main information as StringBuffer
See Also:
Storable.toXML()

extractFurtherInfos

protected void extractFurtherInfos(StringBuffer representation)
                            throws NonParsableException
Description copied from class: AnnotatedEntity
This method can be used in the constructor with parameter StringBuffer to extract the further information.

Specified by:
extractFurtherInfos in class AnnotatedEntity
Parameters:
representation - a XML represenation of the main information as StringBuffer
Throws:
NonParsableException - if the XML representation is not parsable
See Also:
AnnotatedEntity.AnnotatedEntity(StringBuffer)

toString

public String toString()
Overrides:
toString in class Object

print

public void print(PrintWriter writer)
Prints the information of this ListResult to the provided PrintWriter.

Parameters:
writer - the PrintWriter

sort

public ListResult sort(String columnName)
                throws IllegalArgumentException
This method enables you to sort the entries of this container by a specified column.

Parameters:
columnName - the name of the column to be sorted
Returns:
a new ListResult, where the entries of the specified column are sorted
Throws:
IllegalArgumentException - if not all entries have a column with this name