/** * Returns the {@linkplain #getMinimum() minimum value} with the specified inclusive or * exclusive state. If this range is unbounded, then {@link Double#NEGATIVE_INFINITY} is * returned. * * @param inclusive {@code true} for the minimum value inclusive, or {@code false} for the * minimum value exclusive. * @return The minimum value, inclusive or exclusive as requested. */ public double getMinimum(final boolean inclusive) { double value = getMinimum(); if (inclusive != isMinIncluded()) { value = XMath.rool(getElementClass(), value, inclusive ? +1 : -1); } return value; }
this.range = range; Class<?> type = range.getElementClass(); boolean minInc = range.isMinIncluded(); boolean maxInc = range.isMaxIncluded(); this.minimum = doubleValue(type, range.getMinValue(), minInc ? 0 : +1);
maxIncluded = !range.isMinIncluded();
new Range<Double>( catRange.getMinimum(), catRange.isMinIncluded(), catRange.getMaximum(), catRange.isMaxIncluded());
@Override public int compare(SLDSelector o1, SLDSelector o2) { NumberRange<Double> sr1 = o1.scaleRange; NumberRange<Double> sr2 = o2.scaleRange; if (sr1.getMinimum() == sr2.getMinimum()) { if (sr1.isMinIncluded()) { return sr2.isMinIncluded() ? 0 : -1; } else { return sr2.isMinIncluded() ? 1 : 0; } } else { return sr1.getMinimum() > sr2.getMinimum() ? 1 : -1; } } }
/** * Returns the {@linkplain #getMinimum() minimum value} with the specified inclusive or * exclusive state. If this range is unbounded, then {@link Double#NEGATIVE_INFINITY} is * returned. * * @param inclusive {@code true} for the minimum value inclusive, * or {@code false} for the minimum value exclusive. * @return The minimum value, inclusive or exclusive as requested. */ public double getMinimum(final boolean inclusive) { double value = getMinimum(); if (inclusive != isMinIncluded()) { value = XMath.rool(getElementClass(), value, inclusive ? +1 : -1); } return value; }
/** * Returns the {@linkplain #getMinimum() minimum value} with the specified inclusive or * exclusive state. If this range is unbounded, then {@link Double#NEGATIVE_INFINITY} is * returned. * * @param inclusive * {@code true} for the minimum value inclusive, or {@code false} * for the minimum value exclusive. * @return The minimum value, inclusive or exclusive as requested. */ public double getMinimum(final boolean inclusive) { double value = getMinimum(); if (inclusive != isMinIncluded()) { 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 MathTransform1D tr = inverse.transform; final NumberRange r = inverse.range; boolean minIncluded = r.isMinIncluded(); boolean maxIncluded = r.isMaxIncluded(); double min = tr.transform(r.getMinimum());
final MathTransform1D tr = inverse.transform; final NumberRange<? extends Number> r = inverse.range; boolean minIncluded = r.isMinIncluded(); boolean maxIncluded = r.isMaxIncluded(); double min = tr.transform(r.getMinimum());
this.range = range; Class type = range.getElementClass(); boolean minInc = range.isMinIncluded(); boolean maxInc = range.isMaxIncluded(); this.minimum = doubleValue(type, range.getMinValue(), minInc ? 0 : +1);
int sMinInc = sampleValueRange.isMinIncluded() ? 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;
int sMinInc = sampleValueRange.isMinIncluded() ? 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;
this.range = inputRange; Class<? extends Number> type = inputRange.getElementClass(); boolean minInc = inputRange.isMinIncluded(); boolean maxInc = inputRange.isMaxIncluded(); final double tempMin = inputRange.getMinimum();
/** * 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; }
this.range = range; Class<?> type = range.getElementClass(); boolean minInc = range.isMinIncluded(); boolean maxInc = range.isMaxIncluded(); this.minimum = doubleValue(type, range.getMinValue(), minInc ? 0 : +1);
int sMinInc = sourceRange.isMinIncluded() ? 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 minIncluded = scale.isMinIncluded(); boolean maxIncluded = scale.isMaxIncluded(); if (scale instanceof MeasurementRange) { minimum = (minimum / 100) * extent + lower; maximum = (maximum / 100) * extent + lower; minIncluded &= range.isMinIncluded(); maxIncluded &= range.isMaxIncluded();
} else { Range<Double> noData = new Range<Double>(catRange.getMinimum(), catRange.isMinIncluded(), catRange.getMaximum(), catRange.isMaxIncluded()); noDataList.add(noData);