Package com.fa993.types.supertype
Class NumOrTwoSeqOrNdArr
- java.lang.Object
-
- com.fa993.types.supertype.Either.OfThree<Double,double[],double[][]>
-
- com.fa993.types.supertype.NumOrTwoSeqOrNdArr
-
public class NumOrTwoSeqOrNdArr extends Either.OfThree<Double,double[],double[][]>
Represents a specialized version ofEither.OfThreethat can hold one of three types:- A
Doublevalue - An array of two
doublevalues - A 2D array of
doublevalues
- A
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNumOrTwoSeqOrNdArr(Double first, double[] second, double[][] third, Either.Selector selector)Constructs aNumOrTwoSeqOrNdArrinstance with the specified value and selector.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NumOrTwoSeqOrNdArrfirst(Double first)Creates aNumOrTwoSeqOrNdArrinstance with theDoublevalue selected.static NumOrTwoSeqOrNdArrsecond(double[] second)Creates aNumOrTwoSeqOrNdArrinstance with the array of twodoublevalues selected.static NumOrTwoSeqOrNdArrthird(double[][] third)Creates aNumOrTwoSeqOrNdArrinstance with the 2D array ofdoublevalues selected.-
Methods inherited from class com.fa993.types.supertype.Either.OfThree
first, getFirst, getSecond, getSelector, getThird, second, third
-
-
-
-
Constructor Detail
-
NumOrTwoSeqOrNdArr
protected NumOrTwoSeqOrNdArr(Double first, double[] second, double[][] third, Either.Selector selector)
Constructs aNumOrTwoSeqOrNdArrinstance with the specified value and selector.- Parameters:
first- theDoublevalue, ornullif not selectedsecond- the array of twodoublevalues, ornullif not selectedthird- the 2D array ofdoublevalues, ornullif not selectedselector- theEither.Selectorindicating the selected type
-
-
Method Detail
-
first
public static NumOrTwoSeqOrNdArr first(Double first)
Creates aNumOrTwoSeqOrNdArrinstance with theDoublevalue selected.- Parameters:
first- theDoublevalue (must not benull)- Returns:
- a
NumOrTwoSeqOrNdArrinstance with theDoublevalue selected - Throws:
NullPointerException- iffirstisnull
-
second
public static NumOrTwoSeqOrNdArr second(double[] second)
Creates aNumOrTwoSeqOrNdArrinstance with the array of twodoublevalues selected.- Parameters:
second- the array of twodoublevalues (must not benull, and must have a length of 2)- Returns:
- a
NumOrTwoSeqOrNdArrinstance with the array of twodoublevalues selected - Throws:
NullPointerException- ifsecondisnullIllegalArgumentException- ifseconddoes not have a length of 2
-
third
public static NumOrTwoSeqOrNdArr third(double[][] third)
Creates aNumOrTwoSeqOrNdArrinstance with the 2D array ofdoublevalues selected.- Parameters:
third- the 2D array ofdoublevalues (must not benull)- Returns:
- a
NumOrTwoSeqOrNdArrinstance with the 2D array ofdoublevalues selected - Throws:
NullPointerException- ifthirdisnull
-
-