/** * Returns the {@linkplain #getMaximum() maximum value} with the specified inclusive or * exclusive state. If this range is unbounded, then {@link Double#POSITIVE_INFINITY} is * returned. * * @param inclusive {@code true} for the maximum value inclusive, or {@code false} for the * maximum value exclusive. * @return The maximum value, inclusive or exclusive as requested. */ public double getMaximum(final boolean inclusive) { double value = getMaximum(); if (inclusive != isMaxIncluded()) { value = XMath.rool(getElementClass(), value, inclusive ? -1 : +1); } return value; } }
Class<?> type = range.getElementClass(); boolean minInc = range.isMinIncluded(); boolean maxInc = range.isMaxIncluded(); this.minimum = doubleValue(type, range.getMinValue(), minInc ? 0 : +1); this.maximum = doubleValue(type, range.getMaxValue(), maxInc ? 0 : -1);
minIncluded = !range.isMaxIncluded();
catRange.isMinIncluded(), catRange.getMaximum(), catRange.isMaxIncluded()); noDataList.add(noData);
/** * Returns the {@linkplain #getMaximum() maximum value} with the specified inclusive or * exclusive state. If this range is unbounded, then {@link Double#POSITIVE_INFINITY} is * returned. * * @param inclusive * {@code true} for the maximum value inclusive, or {@code false} * for the maximum value exclusive. * @return The maximum value, inclusive or exclusive as requested. */ public double getMaximum(final boolean inclusive) { double value = getMaximum(); if (inclusive != isMaxIncluded()) { value = XMath.rool(getElementClass(), value, inclusive ? -1 : +1); } return value; } }
/** * Returns the {@linkplain #getMaximum() maximum value} with the specified inclusive or * exclusive state. If this range is unbounded, then {@link Double#POSITIVE_INFINITY} is * returned. * * @param inclusive {@code true} for the maximum value inclusive, * or {@code false} for the maximum value exclusive. * @return The maximum value, inclusive or exclusive as requested. */ public double getMaximum(final boolean inclusive) { double value = getMaximum(); if (inclusive != isMaxIncluded()) { value = XMath.rool(getElementClass(), value, inclusive ? -1 : +1); } return value; } }
public SLDSelector(NumberRange<?> scaleRange, Filter filter) { this.scaleRange = new NumberRange( Double.class, scaleRange.getMinimum(), scaleRange.isMinIncluded(), scaleRange.getMaximum(), scaleRange.isMaxIncluded()); this.filter = filter; }
final NumberRange r = inverse.range; boolean minIncluded = r.isMinIncluded(); boolean maxIncluded = r.isMaxIncluded(); double min = tr.transform(r.getMinimum()); double max = tr.transform(r.getMaximum());
final NumberRange<? extends Number> r = inverse.range; boolean minIncluded = r.isMinIncluded(); boolean maxIncluded = r.isMaxIncluded(); double min = tr.transform(r.getMinimum()); double max = tr.transform(r.getMaximum());
int sMaxInc = sampleValueRange.isMaxIncluded() ? 0 : -1; int gMinInc = geophysicsValueRange.isMinIncluded() ? 0 : +1; int gMaxInc = geophysicsValueRange.isMaxIncluded() ? 0 : -1; if (sMinInc == gMinInc) sMinInc = gMinInc = 0; if (sMaxInc == gMaxInc) sMaxInc = gMaxInc = 0;
Class type = range.getElementClass(); boolean minInc = range.isMinIncluded(); boolean maxInc = range.isMaxIncluded(); this.minimum = doubleValue(type, range.getMinValue(), minInc ? 0 : +1); this.maximum = doubleValue(type, range.getMaxValue(), maxInc ? 0 : -1);
int sMaxInc = sampleValueRange.isMaxIncluded() ? 0 : -1; int gMinInc = geophysicsValueRange.isMinIncluded() ? 0 : +1; int gMaxInc = geophysicsValueRange.isMaxIncluded() ? 0 : -1; if (sMinInc == gMinInc) sMinInc = gMinInc = 0; if (sMaxInc == gMaxInc) sMaxInc = gMaxInc = 0;
/** * Retrieves a best guess for the sample value to use for background, * inspecting the categories of the provided {@link GridCoverage2D}. * * @param coverage to use for guessing background values. * @return an array of double values to use as a background. */ public static double[] getBackgroundValues(GridCoverage2D coverage) { /* * Get the sample value to use for background. We will try to fetch this * value from one of "no data" categories. For geophysics images, it is * usually NaN. For non-geophysics images, it is usually 0. */ final GridSampleDimension[] sampleDimensions = coverage.getSampleDimensions(); final double[] background = new double[sampleDimensions.length]; for (int i=0; i<background.length; i++) { final NumberRange range = sampleDimensions[i].getBackground().getRange(); final double min = range.getMinimum(); final double max = range.getMaximum(); if (range.isMinIncluded()) { background[i] = min; } else if (range.isMaxIncluded()) { background[i] = max; } else { background[i] = 0.5 * (min + max); } } return background; }
Class<? extends Number> type = inputRange.getElementClass(); boolean minInc = inputRange.isMinIncluded(); boolean maxInc = inputRange.isMaxIncluded(); final double tempMin = inputRange.getMinimum(); final double tempMax = inputRange.getMaximum();
Class<?> type = range.getElementClass(); boolean minInc = range.isMinIncluded(); boolean maxInc = range.isMaxIncluded(); this.minimum = doubleValue(type, range.getMinValue(), minInc ? 0 : +1); this.maximum = doubleValue(type, range.getMaxValue(), maxInc ? 0 : -1);
int sMaxInc = sourceRange.isMaxIncluded() ? 0 : -1; int dMinInc = destinationRange.isMinIncluded() ? 0 : +1; int dMaxInc = destinationRange.isMaxIncluded() ? 0 : -1;
@Override public void marshal( Object source, HierarchicalStreamWriter writer, MarshallingContext context) { NumberRange<?> range = (NumberRange<?>) source; writer.startNode("minValue"); writer.setValue(String.valueOf(range.getMinValue())); writer.endNode(); writer.startNode("maxValue"); writer.setValue(String.valueOf(range.getMaxValue())); writer.endNode(); if (!range.isMinIncluded()) { writer.startNode("isMinIncluded"); writer.setValue("false"); writer.endNode(); } if (!range.isMaxIncluded()) { writer.startNode("isMaxIncluded"); writer.setValue("false"); writer.endNode(); } }
boolean maxInc = outRange.isMaxIncluded(); outputMinimum = PiecewiseUtilities.doubleValue(type, outRange .getMinValue(), minInc ? 0 : +1);
double maximum = scale.getMaximum(); boolean minIncluded = scale.isMinIncluded(); boolean maxIncluded = scale.isMaxIncluded(); if (scale instanceof MeasurementRange) { try { maximum = (maximum / 100) * extent + lower; minIncluded &= range.isMinIncluded(); maxIncluded &= range.isMaxIncluded();
Range<Double> noData = new Range<Double>(catRange.getMinimum(), catRange.isMinIncluded(), catRange.getMaximum(), catRange.isMaxIncluded()); noDataList.add(noData);