Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.results
Class ResultSet

    java.lang.Object
      de.jstacs.results.ResultSet

All Implemented Interfaces:
  Storable

Direct Known Subclasses:
  NumericalResultSet, SequenceAnnotation

    public class ResultSet

extends Object
implements Storable

Class for a set of `Result`s which provides methods to access single `Result`s in the set, to retrieve the number of `Result`s in the set, to get a `String` representation or an XML representation of all the `Result`s in the set.

Author:
  Jan Grau, Jens Keilwagen

Field Summary
`protected Result[]` | `results` The set of results as an array of `Result`s.

Constructor Summary
`ResultSet(Collection<? extends Result> results)` Constructs a new `ResultSet` from a `Collection` of type `Result`.
`ResultSet(Result result)` Constructs a new `ResultSet` containing one `Result`.
`ResultSet(Result[]... results)` Constructs a new `ResultSet` from a two-dimensional array of `Result`s.
`ResultSet(StringBuffer representation)` The standard constructor for the interface `Storable`.

Method Summary
`int` | `findColumn(String columnName)` This method enables you to search for a column.
`protected void` | `fromXML(StringBuffer representation)` Parses the contents of a `ResultSet` from its XML representation as returned by `toXML()`.
`int` | `getNumberOfResults()` Returns the number of `Result`s in this `ResultSet`
`Result` | `getResultAt(int index)` Returns `Result` number `index` in this `ResultSet`.
`Result[]` | `getResults()` Returns all internal results as an array of `Result`s.
`String` | `toString()`
`StringBuffer` | `toXML()` This method returns an XML representation as `StringBuffer` of an instance of the implementing class.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### results

    protected Result[] results

  The set of results as an array of `Result`s.

Constructor Detail

### ResultSet

    public ResultSet(Result result)

  Constructs a new `ResultSet` containing one `Result`.

  Parameters:
    `result` - the `Result` to be contained

### ResultSet

    public ResultSet(Result[]... results)

  Constructs a new `ResultSet` from a two-dimensional array of `Result`s.

  Parameters:
    `results` - the two-dimensional array of `Result`s

### ResultSet

    public ResultSet(Collection<? extends Result> results)

  Constructs a new `ResultSet` from a `Collection` of type `Result`.

  Parameters:
    `results` - a `Collection` of `Result`s

### ResultSet

    public ResultSet(StringBuffer representation)
              throws NonParsableException

  The standard constructor for the interface `Storable`. Constructs a `ResultSet` from its XML representation.

  Parameters:
    `representation` - the XML representation as `StringBuffer`
  Throws:
    `NonParsableException` - if the `StringBuffer` `representation` could not be parsed

Method Detail

### getResultAt

    public Result getResultAt(int index)

  Returns `Result` number `index` in this `ResultSet`.

  Parameters:
    `index` - the index of the `Result`
  Returns:
    the `Result` at `index`

### getResults

    public Result[] getResults()

  Returns all internal results as an array of `Result`s.

  Returns:
    all internal results as an array of `Result`s

### getNumberOfResults

    public int getNumberOfResults()

  Returns the number of `Result`s in this `ResultSet`

  Returns:
    the number of `Result`s

### toXML

    public StringBuffer toXML()

  Description copied from interface: `Storable`
  This method returns an XML representation as `StringBuffer` of an instance of the implementing class.

  Specified by:
    `toXML` in interface `Storable`
  Returns:
    the XML representation

### fromXML

    protected void fromXML(StringBuffer representation)
                    throws NonParsableException

  Parses the contents of a `ResultSet` from its XML representation as returned by `toXML()`.

  Parameters:
    `representation` - the XML representation as `StringBuffer`
  Throws:
    `NonParsableException` - if the XML code could not be parsed

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### findColumn

    public int findColumn(String columnName)

  This method enables you to search for a column. It returns the index of the column, if it could be found, otherwise -1.

  Parameters:
    `columnName` - the name of the column
  Returns:
    the index of the column, if it could be found, otherwise -1.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD