de.unibi.techfak.jpredictor.operator
Class ScoreBand

java.lang.Object
  extended by de.unibi.techfak.jpredictor.operator.ScoreBand

public class ScoreBand
extends java.lang.Object

Stores one band of scores. Is also used to process scores.


Field Summary
private  int count
          Number of scores comprised in this band.
private  int end
          The end of the band, e.g.
private  int id
          The id of the band, e.g.
private  double maxScore
          The maximum of all scores comprised in this band.
private  double minScore
          The minimum of all scores comprised in this band.
private  int start
          The start of the band, e.g.
private  double sumScore
          The sum over all scores comprised in this band.
 
Constructor Summary
ScoreBand(ScoredSequenceStruct sss)
          Inits this band with a score on a sequence.
 
Method Summary
 boolean addBand(ScoreBand sb)
          Adds a whole band to this one.
 boolean addScore(ScoredSequenceStruct sss)
          Adds a score to this band.
 int getCount()
          Gives the number of scores previously added to the band.
 int getEnd()
          Gives the end position of the band.
 int getId()
          Gives the id of the band.
 double getMaxScore()
          Gives the maximum of all scores previously added to the band.
 double getMeanScore()
          Gives the mean of all scores previously added to the band.
 double getMinScore()
          Gives the minimum of all scores previously added to the band.
 int getStart()
          Gives the start position of the band.
 double getSumScore()
          Gives the sum scores over all scores previously added to the band.
 java.lang.String toString()
          Prints a string containing all informations stored in this band.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private int id
The id of the band, e.g. the number of the sequence actually processed.


start

private int start
The start of the band, e.g. on the sequence.


end

private int end
The end of the band, e.g. on the sequence.


minScore

private double minScore
The minimum of all scores comprised in this band.


maxScore

private double maxScore
The maximum of all scores comprised in this band.


count

private int count
Number of scores comprised in this band.


sumScore

private double sumScore
The sum over all scores comprised in this band.

Constructor Detail

ScoreBand

public ScoreBand(ScoredSequenceStruct sss)
          throws java.lang.NullPointerException
Inits this band with a score on a sequence. The sequence number is stored in the id.

Parameters:
sss - The score within a sequence window to init this band.
Throws:
java.lang.NullPointerException - If the parameter is null.
Method Detail

addScore

public boolean addScore(ScoredSequenceStruct sss)
Adds a score to this band. The score is only added if the id in this band equals the seqNumber of the given struct.

Parameters:
sss - The score within a sequence window to add to this band.
Returns:
true, iff the score was added, false otherwise.

addBand

public boolean addBand(ScoreBand sb)
Adds a whole band to this one. If both id's do not match, nothing is added.

Parameters:
sb - The band that is to be added to this one.
Returns:
true, iff the band was added, false otherwise.

getCount

public int getCount()
Gives the number of scores previously added to the band.

Returns:
The number of scores added to the band.

getEnd

public int getEnd()
Gives the end position of the band. The end position is the maximum of all positions that came with the added scores.

Returns:
The end position of the band.

getId

public int getId()
Gives the id of the band. The id was set with the score this band was constructed with. Only scores with the same id (that is the seqNumber) are added to the band.

Returns:
The identifikation number of the band.

getMaxScore

public double getMaxScore()
Gives the maximum of all scores previously added to the band.

Returns:
The maximum of all scores added to this band.

getMinScore

public double getMinScore()
Gives the minimum of all scores previously added to the band.

Returns:
The minimum of all scores added to this band.

getStart

public int getStart()
Gives the start position of the band. The starting position is the minimum of all positions that came with the added scores.

Returns:
The start position of the band.

getSumScore

public double getSumScore()
Gives the sum scores over all scores previously added to the band.

Returns:
The sum score over all scores added to the band.

getMeanScore

public double getMeanScore()
Gives the mean of all scores previously added to the band.

Returns:
The mean value of all scores added to this band.

toString

public java.lang.String toString()
Prints a string containing all informations stored in this band. The form is 'id:start-end:max;min;mean'.

Overrides:
toString in class java.lang.Object