Package com.fa993.utils
Class SelectByProperty
- java.lang.Object
-
- com.fa993.utils.SelectByProperty
-
public class SelectByProperty extends Object
Utility class for evaluating properties of peaks against defined intervals. This class provides methods to filter peaks based on their properties conforming to specified minimum and maximum boundary conditions. These boundaries can be scalars or arrays.
-
-
Constructor Summary
Constructors Constructor Description SelectByProperty()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean[]
call(double[] peakProperties, Either.OfTwo<Double,double[]> pmin, Either.OfTwo<Double,double[]> pmax)
Evaluates which peaks conform to a specified interval based on their properties.static boolean[]
call(int[] peakProperties, Either.OfTwo<Double,double[]> pmin, Either.OfTwo<Double,double[]> pmax)
Evaluates which peaks conform to a specified interval based on their properties.
-
-
-
Method Detail
-
call
public static boolean[] call(int[] peakProperties, Either.OfTwo<Double,double[]> pmin, Either.OfTwo<Double,double[]> pmax)
Evaluates which peaks conform to a specified interval based on their properties. The interval is defined by optional minimum and maximum boundaries.- Parameters:
peakProperties
- an array representing the properties of each peak.pmin
- the lower boundary of the interval. This can be:- A scalar value applied uniformly to all peaks.
- An array of values, where each corresponds to a specific peak.
- Null, indicating no lower boundary is applied.
pmax
- the upper boundary of the interval. This can be:- A scalar value applied uniformly to all peaks.
- An array of values, where each corresponds to a specific peak.
- Null, indicating no upper boundary is applied.
- Returns:
- a boolean array where each element evaluates to
true
if the corresponding peak conforms to the interval, andfalse
otherwise. - Throws:
IllegalArgumentException
- ifpmin
orpmax
is an array of a different length thanpeakProperties
.
-
call
public static boolean[] call(double[] peakProperties, Either.OfTwo<Double,double[]> pmin, Either.OfTwo<Double,double[]> pmax)
Evaluates which peaks conform to a specified interval based on their properties. The interval is defined by optional minimum and maximum boundaries. This method operates on properties represented as double arrays.- Parameters:
peakProperties
- an array of double values representing the properties of each peak.pmin
- the lower boundary of the interval. This can be:- A scalar value applied uniformly to all peaks.
- An array of values, where each corresponds to a specific peak.
- Null, indicating no lower boundary is applied.
pmax
- the upper boundary of the interval. This can be:- A scalar value applied uniformly to all peaks.
- An array of values, where each corresponds to a specific peak.
- Null, indicating no upper boundary is applied.
- Returns:
- a boolean array where each element evaluates to
true
if the corresponding peak conforms to the interval, andfalse
otherwise. - Throws:
IllegalArgumentException
- ifpmin
orpmax
is an array of a different length thanpeakProperties
.
-
-