org.geotools.util.Range.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中org.geotools.util.Range.<init>方法的一些代码示例,展示了Range.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.<init>方法的具体详情如下:
包路径:org.geotools.util.Range
类名称:Range
方法名:<init>

Range.<init>介绍

[英]Creates a new range bounded by a single inclusive value. The #getMinimumand #getMaximum values are set to the given one.
[中]创建由单个包含值限定的新范围。#getMinimumand#getMaximum值设置为给定值。

代码示例

代码示例来源:origin: geotools/geotools

/**
 * Creates a new range using the same element class than this range. This method will be
 * overriden by subclasses in order to create a range of a more specific type.
 */
Range<T> create(
    final T minValue,
    final boolean isMinIncluded,
    final T maxValue,
    final boolean isMaxIncluded) {
  return new Range<T>(elementClass, minValue, isMinIncluded, maxValue, isMaxIncluded);
}

代码示例来源:origin: geotools/geotools

public MultiRange(Class<T> binding, T exclusion) {
  this.ranges.add(new Range(binding, null, false, exclusion, false));
  this.ranges.add(new Range(binding, exclusion, false, null, false));
}

代码示例来源:origin: geotools/geotools

return new Range<Byte>(Byte.class, (Byte) firstValue, (Byte) secondValue);
} else if (targetClass == Short.class) {
  return new Range<Short>(Short.class, (Short) firstValue, (Short) secondValue);
} else if (targetClass == Integer.class) {
  return new Range<Integer>(Integer.class, (Integer) firstValue, (Integer) secondValue);
} else if (targetClass == Long.class) {
  return new Range<Long>(Long.class, (Long) firstValue, (Long) secondValue);
} else if (targetClass == Float.class) {
  return new Range<Float>(Float.class, (Float) firstValue, (Float) secondValue);
} else if (targetClass == Double.class) {
  return new Range<Double>(Double.class, (Double) firstValue, (Double) secondValue);
} else return null;

代码示例来源:origin: geotools/geotools

/**
 * Returns a new {@link Range} object initialized with the given values.
 *
 * @param lower The lower value, inclusive.
 * @param upper The upper value, inclusive.
 */
private Range<T> newRange(final T lower, final T upper) {
  if (isNumeric) {
    return new NumberRange(elementClass, lower, upper);
  } else {
    return new Range<T>(elementClass, lower, upper);
  }
}

代码示例来源:origin: geotools/geotools

/** Add a metadata element to the FileGroup metadata map */
protected void addMetadaElement(
    String name, Comparable min, Comparable max, Map<String, Object> metadataMap) {
  if (Utils.TIME_DOMAIN.equalsIgnoreCase(name) || min instanceof Date) {
    metadataMap.put(name.toUpperCase(), new DateRange((Date) min, (Date) max));
  } else if (Utils.ELEVATION_DOMAIN.equalsIgnoreCase(name) || min instanceof Number) {
    metadataMap.put(
        name.toUpperCase(),
        NumberRange.create(
            ((Number) min).doubleValue(),
            true,
            ((Number) max).doubleValue(),
            true));
  } else {
    metadataMap.put(name, new Range(String.class, (String) min, (String) max));
  }
}

代码示例来源:origin: geotools/geotools

/** Add a metadata element to the FileGroup metadata map */
private void addMetadaElement(
    String name, Comparable min, Comparable max, Map<String, Object> metadataMap) {
  if (Utils.TIME_DOMAIN.equalsIgnoreCase(name) || min instanceof Date) {
    metadataMap.put(name.toUpperCase(), new DateRange((Date) min, (Date) max));
  } else if (Utils.ELEVATION_DOMAIN.equalsIgnoreCase(name) || min instanceof Number) {
    metadataMap.put(
        name.toUpperCase(),
        NumberRange.create(
            ((Number) min).doubleValue(),
            true,
            ((Number) max).doubleValue(),
            true));
  } else {
    metadataMap.put(name, new Range(String.class, (String) min, (String) max));
  }
}

代码示例来源:origin: geotools/geotools

if (value != null) {
  if (op instanceof PropertyIsLessThan) {
    range = new Range(binding, null, false, (Comparable) value, false);
  } else if (op instanceof PropertyIsLessThanOrEqualTo) {
    range = new Range(binding, null, false, (Comparable) value, true);
  } else if (op instanceof PropertyIsEqualTo) {
    range = new Range(binding, (Comparable) value, (Comparable) value);
  } else if (op instanceof PropertyIsGreaterThanOrEqualTo) {
    range = new Range(binding, (Comparable) value, true, null, false);
  } else if (op instanceof PropertyIsGreaterThan) {
    range = new Range(binding, (Comparable) value, false, null, false);
if (value != null) {
  if (op instanceof PropertyIsLessThan) {
    range = new Range(binding, (Comparable) value, true, null, false);
  } else if (op instanceof PropertyIsLessThanOrEqualTo) {
    range = new Range(binding, (Comparable) value, false, null, false);
  } else if (op instanceof PropertyIsEqualTo) {
    range = new Range(binding, (Comparable) value, (Comparable) value);
  } else if (op instanceof PropertyIsGreaterThanOrEqualTo) {
    range = new Range(binding, null, false, (Comparable) value, false);
  } else if (op instanceof PropertyIsGreaterThan) {
    range = new Range(binding, null, false, (Comparable) value, true);

代码示例来源:origin: geotools/geotools

} else {
  Range<T> union =
      new Range<T>(
          range.getElementClass(),
          (T) range.getMinValue(),

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Creates a new range using the same element class than this range. This method will
 * be overriden by subclasses in order to create a range of a more specific type.
 */
Range<T> create(final T minValue, final boolean isMinIncluded,
        final T maxValue, final boolean isMaxIncluded)
{
  return new Range<T>(elementClass, minValue, isMinIncluded, maxValue, isMaxIncluded);
}

代码示例来源:origin: geotools/geotools

} else {
  Expression expression = pb.getExpression();
  Range<?> range = new Range(binding, (Comparable) min, (Comparable) max);
  addRange(rangeMap, expression, new MultiRange(range));

代码示例来源:origin: org.geotools/gt-css

public ScaleRange(double min, boolean minIncluded, double max, boolean maxIncluded) {
  this.range = new Range<Double>(Double.class, min, minIncluded, max, maxIncluded);
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Returns a new {@link Range} object initialized with the given values.
 *
 * @param lower The lower value, inclusive.
 * @param upper The upper value, inclusive.
 */
private Range<T> newRange(final T lower, final T upper) {
  if (isNumeric) {
    return new NumberRange(elementClass, lower, upper);
  } else {
    return new Range<T>(elementClass, lower, upper);
  }
}

代码示例来源:origin: org.geotools/gt-netcdf

/** Add a metadata element to the FileGroup metadata map */
protected void addMetadaElement(
    String name, Comparable min, Comparable max, Map<String, Object> metadataMap) {
  if (Utils.TIME_DOMAIN.equalsIgnoreCase(name) || min instanceof Date) {
    metadataMap.put(name.toUpperCase(), new DateRange((Date) min, (Date) max));
  } else if (Utils.ELEVATION_DOMAIN.equalsIgnoreCase(name) || min instanceof Number) {
    metadataMap.put(
        name.toUpperCase(),
        NumberRange.create(
            ((Number) min).doubleValue(),
            true,
            ((Number) max).doubleValue(),
            true));
  } else {
    metadataMap.put(name, new Range(String.class, (String) min, (String) max));
  }
}

代码示例来源:origin: locationtech/geogig

/**
 * Show only commits that lie within the specified time range.
 * 
 * @param commitRange time range to show commits from
 * @return {@code this}
 */
public LogOp setTimeRange(final Range<Date> commitRange) {
  if (commitRange == null) {
    this.timeRange = ALWAYS;
  } else {
    this.timeRange = new Range<Long>(Long.class, commitRange.getMinValue().getTime(),
        commitRange.isMinIncluded(), commitRange.getMaxValue().getTime(),
        commitRange.isMaxIncluded());
  }
  return this;
}

代码示例来源:origin: org.geogit/geogit-core

/**
 * Show only commits that lie within the specified time range.
 * 
 * @param commitRange time range to show commits from
 * @return {@code this}
 */
public LogOp setTimeRange(final Range<Date> commitRange) {
  if (commitRange == null) {
    this.timeRange = ALWAYS;
  } else {
    this.timeRange = new Range<Long>(Long.class, commitRange.getMinValue().getTime(),
        commitRange.isMinIncluded(), commitRange.getMaxValue().getTime(),
        commitRange.isMaxIncluded());
  }
  return this;
}

代码示例来源:origin: org.locationtech.geogig/geogig-core

/**
 * Show only commits that lie within the specified time range.
 * 
 * @param commitRange time range to show commits from
 * @return {@code this}
 */
public LogOp setTimeRange(final Range<Date> commitRange) {
  if (commitRange == null) {
    this.timeRange = ALWAYS;
  } else {
    this.timeRange = new Range<Long>(Long.class, commitRange.getMinValue().getTime(),
        commitRange.isMinIncluded(), commitRange.getMaxValue().getTime(),
        commitRange.isMaxIncluded());
  }
  return this;
}

代码示例来源:origin: org.geoserver/gs-wms

@Override
public Object getDefaultValue(
    ResourceInfo resource, String dimensionName, DimensionInfo dimension, Class clz) {
  if (value instanceof Range) {
    Range r = (Range) value;
    if (clz.isAssignableFrom(r.getElementClass())) {
      return r;
    } else {
      Comparable min = (Comparable) Converters.convert(r.getMinValue(), clz);
      Comparable max = (Comparable) Converters.convert(r.getMaxValue(), clz);
      return new Range(clz, min, max);
    }
  } else {
    return Converters.convert(this.value, clz);
  }
}

代码示例来源:origin: locationtech/geogig

Range<Date> commitRange = new Range<Date>(Date.class, new Date(2000), minInclusive,
    new Date(5000), maxInclusive);
logOp.setTimeRange(commitRange);
commitRange = new Range<Date>(Date.class, new Date(2000), minInclusive, new Date(5000),
    maxInclusive);
logOp = geogig.command(LogOp.class).setTimeRange(commitRange);

代码示例来源:origin: org.locationtech.geogig/geogig-core

Range<Date> commitRange = new Range<Date>(Date.class, new Date(2000), minInclusive,
    new Date(5000), maxInclusive);
logOp.setTimeRange(commitRange);
commitRange = new Range<Date>(Date.class, new Date(2000), minInclusive, new Date(5000),
    maxInclusive);
logOp = geogig.command(LogOp.class).setTimeRange(commitRange);

代码示例来源:origin: org.geogit/geogit-core

Range<Date> commitRange = new Range<Date>(Date.class, new Date(2000), minInclusive,
    new Date(5000), maxInclusive);
logOp.setTimeRange(commitRange);
commitRange = new Range<Date>(Date.class, new Date(2000), minInclusive, new Date(5000),
    maxInclusive);
logOp = geogit.command(LogOp.class).setTimeRange(commitRange);

相关文章