java.lang.Object
com.pervasive.datarush.analytics.pmml.PMMLArrays
Utility methods for formatting and parsing PMML arrays
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of PMML array types -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddChildArrayElement(Element element, double[] values) Adds a childArrayelement to the given element.static voidaddChildArrayElement(Element element, int[] values) Adds a childArrayelement to the given element.static voidaddChildArrayElement(Element element, long[] values) Adds a childArrayelement to the given element.static voidaddChildArrayElement(Element element, Object[] values, PMMLArrays.ArrayType type) Adds a childArrayelement to the given element.static voidaddChildArrayElement(Element element, BigDecimal[] values) Adds a childArrayelement to the given element.static voidaddSparseChildArrayElement(Element element, DoubleTokenSequence sequence) Adds a childREAL-SparseArrayelement to the given element.static voidaddSparseChildArrayElement(Element element, IntTokenSequence sequence) Adds a childINT-SparseArrayelement to the given element.static voidaddSparseChildArrayElement(Element element, NumericTokenSequence sequence) Adds a childREAL-SparseArrayelement to the given element.static BigDecimal[]Parses the single childArrayelement as an array of BigDecimals.static double[]parseChildArrayElementAsDoubles(Element element) Parses the single childArrayelement as an array of doubles.static int[]parseChildArrayElementAsInts(Element element) Parses the single childArrayelement as an array of ints.static String[]parseChildArrayElementAsStrings(Element element) Parses the single childArrayelement as an array of strings.static BigDecimal[][]Parses all childArrayelements as arrays of BigDecimals.static Double[][]parseChildArrayElementsAsDoubles(Element element) Parses all childArrayelements as arrays of doubles.static String[][]parseChildArrayElementsAsStrings(Element element) Parses all childArrayelements as arrays of strings.static DoubleTokenSequenceparseSparseChildArrayElement(Element element) Parses the single childREAL-SparseArrayorINT-SparseArrayelement.
-
Method Details
-
addChildArrayElement
Adds a childArrayelement to the given element. The child array will be of typePMMLArrays.ArrayType.real.- Parameters:
element- the parent elementvalues- the values of the array
-
addChildArrayElement
Adds a childArrayelement to the given element. The child array will be of typePMMLArrays.ArrayType.real.- Parameters:
element- the parent elementvalues- the values of the array
-
addChildArrayElement
Adds a childArrayelement to the given element. The child array will be of typePMMLArrays.ArrayType.integer.- Parameters:
element- the parent elementvalues- the values of the array
-
addChildArrayElement
Adds a childArrayelement to the given element. The child array will be of typePMMLArrays.ArrayType.integer.- Parameters:
element- the parent elementvalues- the values of the array
-
addChildArrayElement
public static void addChildArrayElement(Element element, Object[] values, PMMLArrays.ArrayType type) Adds a childArrayelement to the given element. The child array will be of the specified type- Parameters:
element- the parent elementvalues- the values of the arraytype- the type of the elements of the array
-
addSparseChildArrayElement
Adds a childREAL-SparseArrayelement to the given element.- Parameters:
element- the parent elementsequence- the sequence (generally a sparse sequence)
-
addSparseChildArrayElement
Adds a childREAL-SparseArrayelement to the given element.- Parameters:
element- the parent elementsequence- the sequence (generally a sparse sequence)
-
addSparseChildArrayElement
Adds a childINT-SparseArrayelement to the given element.- Parameters:
element- the parent elementsequence- the sequence (generally a sparse sequence)
-
parseChildArrayElementsAsStrings
Parses all childArrayelements as arrays of strings. The type declared in the PMML is ignored.- Parameters:
element- the parent element- Returns:
- a two-dimensional array of strings. the outer array corresponds to the children elements
-
parseChildArrayElementsAsDoubles
Parses all childArrayelements as arrays of doubles. The type declared in the PMML is ignored.- Parameters:
element- the parent element- Returns:
- a two-dimensional array of double. the outer array corresponds to the children elements
-
parseChildArrayElementsAsBigDecimals
Parses all childArrayelements as arrays of BigDecimals. The type declared in the PMML is ignored.- Parameters:
element- the parent element- Returns:
- a two-dimensional array of BigDecimals. the outer array corresponds to the children elements
-
parseChildArrayElementAsStrings
Parses the single childArrayelement as an array of strings. The type declared in the PMML is ignored.- Parameters:
element- the parent element- Returns:
- an array of strings
- Throws:
InvalidPMMLException- if there are multiple children arrays
-
parseChildArrayElementAsDoubles
Parses the single childArrayelement as an array of doubles. The type declared in the PMML is ignored.- Parameters:
element- the parent element- Returns:
- an array of doubles
- Throws:
InvalidPMMLException- if there are multiple children arrays
-
parseChildArrayElementAsBigDecimals
Parses the single childArrayelement as an array of BigDecimals. The type declared in the PMML is ignored.- Parameters:
element- the parent element- Returns:
- an array of BigDecimals
- Throws:
InvalidPMMLException- if there are multiple children arrays
-
parseChildArrayElementAsInts
Parses the single childArrayelement as an array of ints. The type declared in the PMML is ignored.- Parameters:
element- the parent element- Returns:
- an array of ints
- Throws:
InvalidPMMLException- if there are multiple children arrays
-
parseSparseChildArrayElement
Parses the single childREAL-SparseArrayorINT-SparseArrayelement.- Parameters:
element- the parent element- Returns:
- a sparse token sequence
- Throws:
InvalidPMMLException- if there are multiple children arrays
-