AFLPcore
Class LinearCutoff

java.lang.Object
  |
  +--AFLPcore.Operation
        |
        +--AFLPcore.CutoffFunction
              |
              +--AFLPcore.LinearCutoff
All Implemented Interfaces:
java.lang.Cloneable

public class LinearCutoff
extends CutoffFunction

This cutoff function represents a horizontal line. It is set at a specific value, determined by the first (and only) option set. This means that the cutoff hieght is independent of the size. The cutoff functions are used to help score bins and can also be used by peak locating algorithms.

See Also:
CutoffFunction

Fields inherited from class AFLPcore.Operation
descript, helpFile, name, options
 
Constructor Summary
LinearCutoff()
          Creates a new linear function with the value specified in value.
 
Method Summary
 double getCutoff(double position)
          Gives the cutoff point for this function.
 java.lang.String getDescription()
          Gives a brief description of the linear filter.
 java.lang.String getHelpFile()
          Gives help for the linear cutoff.
 java.lang.String getName()
          Gives the name of this linear function.
 Option[] getOptions()
          Returns the options/parameters for this Cutoff function.
 void read(java.io.DataInputStream in)
          Reads in the properties of this class from the specified input stream.
 void setOptions(Option[] opts)
          Set the value for the cutoff.
 void write(java.io.DataOutputStream out)
          Writes all of the information this class needs to store in order to be recreated.
 
Methods inherited from class AFLPcore.CutoffFunction
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearCutoff

public LinearCutoff()
Creates a new linear function with the value specified in value.
Parameters:
value - the number to return as the cutoff
Method Detail

getName

public java.lang.String getName()
Gives the name of this linear function.
Overrides:
getName in class Operation
Returns:
the name for this type of function.

getDescription

public java.lang.String getDescription()
Gives a brief description of the linear filter.
Overrides:
getDescription in class Operation
Returns:
a sentence describing the function.

getHelpFile

public java.lang.String getHelpFile()
Gives help for the linear cutoff.
Overrides:
getHelpFile in class Operation
Returns:
a html or plaintext file with the description. null if this file does not exist.

getOptions

public Option[] getOptions()
Returns the options/parameters for this Cutoff function. In this case, the value to cut off at is required.
Overrides:
getOptions in class Operation
Returns:
an option representing the value to cut off at.

setOptions

public void setOptions(Option[] opts)
Set the value for the cutoff. This must be done before the funtion can work.
Overrides:
setOptions in class Operation
Parameters:
the - option with the value for the cutoff.
Throws:
MissingParameterError - the value was not provided in the opts parameter.

getCutoff

public double getCutoff(double position)
Gives the cutoff point for this function. Since it is linear, it is independent of the position.
Overrides:
getCutoff in class CutoffFunction
Parameters:
position - this parameter is ignored in this case
Throws:
MissingParameterError - occurs if the value for this cutoff function has not been set.

write

public void write(java.io.DataOutputStream out)
           throws java.io.IOException
Writes all of the information this class needs to store in order to be recreated. This will be used for things like storing the class in a file. Therefore, the write should output enough information so that read can recreate the essential properties of this class.
Overrides:
write in class CutoffFunction
Parameters:
out - the destination to write the data to.
Throws:
java.io.IOException - occurs when a problem is encountered when writing to the stream.

read

public void read(java.io.DataInputStream in)
          throws java.io.IOException
Reads in the properties of this class from the specified input stream. The stream data should have been created by write. This will retrieve this classes state from the input stream. All of the current data in this class will be replaced by the data from the stream.
Overrides:
read in class CutoffFunction
Parameters:
in - the input stream with the data for the class.
Throws:
java.io.IOException - occurs when a problem is encountered when writing to the stream.