wrapped = category; if (Category.NODATA.getName().equals(category.getName())) { if (category.isQuantitative()) {
/** * Returns the index of the quantitative category, providing that there is one and only one * quantitative category. If {@code categories} contains 0, 2 or more quantitative category, * then this method returns {@code -1}. * * @param categories The categories to test. * @return The index of the quantitative category, or {@code -1} if none can be choosen. * @since 2.4 */ protected static int getQuantitative(final Category[] categories) { int index = -1; for (int i = 0; i < categories.length; i++) { if (categories[i].isQuantitative()) { if (index >= 0) { return -1; } index = i; } } return index; }
if (!category.isQuantitative()) { final double min = category.minimum; final double max = category.maximum;
for (int i = categories.length; --i >= 0; ) { final Category candidate = categories[i]; if (candidate.isQuantitative()) { final Category candidatePeer = candidate; final double candidateRange = candidatePeer.maximum - candidatePeer.minimum;
/** * Returns a transform from sample values to geophysics values. If this category * is not a quantitative one, then this method returns {@code null}. */ public MathTransform1D getSampleToGeophysics() { return isQuantitative() ? transform : null; }
for (int i = list.size(); --i >= 0; ) { Category category = list.get(i); if (!category.isQuantitative()) { qualitative = true; continue;
/** * Returns {@code true} if this category is quantitative. */ @Override public boolean isQuantitative() { assert !(inverse instanceof GeophysicsCategory) : inverse; return inverse.isQuantitative(); }
/** * Returns {@code true} if this category is quantitative. */ public boolean isQuantitative() { assert !(inverse instanceof GeophysicsCategory) : inverse; return inverse.isQuantitative(); }
/** * Returns a transform from sample values to geophysics values. If this category * is not a quantitative one, then this method returns {@code null}. * * @return The transform from sample values to geophysics values. */ public MathTransform1D getSampleToGeophysics() { return isQuantitative() ? transform : null; }
/** * Returns the index of the quantitative category, providing that there is * one and only one quantitative category. If {@code categories} contains 0, * 2 or more quantitative category, then this method returns {@code -1}. * * @since 2.4 */ protected static int getQuantitative(final Category[] categories) { int index = -1; for (int i=0; i<categories.length; i++) { if (categories[i].isQuantitative()) { if (index >= 0) { return -1; } index = i; } } return index; }
/** * Returns the index of the quantitative category, providing that there is * one and only one quantitative category. If {@code categories} contains 0, * 2 or more quantitative category, then this method returns {@code -1}. * * @param categories The categories to test. * @return The index of the quantitative category, or {@code -1} if none can be choosen. * * @since 2.4 */ protected static int getQuantitative(final Category[] categories) { int index = -1; for (int i=0; i<categories.length; i++) { if (categories[i].isQuantitative()) { if (index >= 0) { return -1; } index = i; } } return index; }
for (int i = categoryList.size(); --i >= 0; ) { Category category = categoryList.get(i); if (!category.isQuantitative()) { final NumberRange range = category.getRange(); final Comparable min = range.getMinValue();
/** * Returns a sample dimension using new {@link #getScale scale} and {@link #getOffset offset} * coefficients. Other properties like the {@linkplain #getRange sample value range}, * {@linkplain #getNoDataValues no data values} and {@linkplain #getColorModel colors} * are unchanged. * * @param scale The value which is multiplied to grid values for the new sample dimension. * @param offset The value to add to grid values for the new sample dimension. * * @see #getScale * @see #getOffset * @see Category#rescale */ public GridSampleDimension rescale(final double scale, final double offset) { final MathTransform1D sampleToGeophysics = Category.createLinearTransform(scale, offset); final Category[] categories = (Category[]) getCategories().toArray(); final Category[] reference = (Category[]) categories.clone(); final int length = categories.length; for (int i = 0; i < length; i++) { if (categories[i].isQuantitative()) { categories[i] = categories[i].rescale(sampleToGeophysics); } categories[i] = categories[i].geophysics(isGeophysics); } if (Arrays.equals(categories, reference)) { return this; } return new GridSampleDimension(description, categories, getUnits()); }
if (band != packed) { for (final Category category : packed.getCategories()) { if (category.isQuantitative()) {
colors = (Color[]) colorMap.get(category.getName().toString()); if (colors == null) { if (!category.isQuantitative()) { continue;
for (int i=0; i<categories.length; i++) { Category category = categories[i]; if (category.isQuantitative()) { category = category.rescale(sampleToGeophysics);
for (int i=0; i<size; i++) { final Category category = categories.get(i); if (!category.isQuantitative()) { final double min = category.minimum; final double max = category.maximum;
for (int i=0; i<size; i++) { final Category category = (Category) categories.get(i); if (!category.isQuantitative()) { final double min = category.minimum; final double max = category.maximum;
Color[] colors = getColors(category.getName()); if (colors == null) { if (category.isQuantitative()) { colors = getColors(ANY_QUANTITATIVE_CATEGORY);
NumberRange scale = getRange(category.getName()); if (scale == null) { if (category.isQuantitative()) { scale = getRange(ANY_QUANTITATIVE_CATEGORY);