PDFFunctionUtils.java
907 Bytes
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException
*/
package com.adobe.internal.pdftoolkit.pdf.graphics.impl;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException;
public class PDFFunctionUtils {
public static void validateDomainORRangeArray(double[] array) throws PDFInvalidParameterException {
int length = array.length;
if (array == null || length == 0 || length % 2 != 0) {
throw new PDFInvalidParameterException("Array passed is either null, empty or have odd number of values.");
}
for (int i = 0; i < length; i += 2) {
if (array[i] <= array[i + 1]) continue;
throw new PDFInvalidParameterException("Element at index 2i should be less than or equal to element at 2i+1");
}
}
}