org.jfree.data.Range.expandToInclude()方法的使用及代码示例

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

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

Range.expandToInclude介绍

[英]Returns a range that includes all the values in the specified range AND the specified value.
[中]返回一个范围,该范围包括指定范围内的所有值和指定值。

代码示例

代码示例来源:origin: jfree/jfreechart

/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.  This takes into account the range
 * of values in the dataset, plus the flag that determines whether or not
 * the base value for the bars should be included in the range.
 *
 * @param dataset  the dataset ({@code null} permitted).
 * @param includeInterval  include the interval if the dataset has one?
 *
 * @return The range (or {@code null} if the dataset is
 *         {@code null} or empty).
 */
@Override
public Range findRangeBounds(CategoryDataset dataset,
    boolean includeInterval) {
  if (dataset == null) {
    return null;
  }
  Range result = super.findRangeBounds(dataset, includeInterval);
  if (result != null) {
    if (this.includeBaseInRange) {
      result = Range.expandToInclude(result, this.base);
    }
  }
  return result;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.  This takes into account the range
 * of values in the dataset, plus the flag that determines whether or not
 * the base value for the bars should be included in the range.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param includeInterval  include the interval if the dataset has one?
 *
 * @return The range (or <code>null</code> if the dataset is
 *         <code>null</code> or empty).
 */
public Range findRangeBounds(CategoryDataset dataset,
    boolean includeInterval) {
  if (dataset == null) {
    return null;
  }
  Range result = super.findRangeBounds(dataset, includeInterval);
  if (result != null) {
    if (this.includeBaseInRange) {
      result = Range.expandToInclude(result, this.base);
    }
  }
  return result;
}

相关文章