gpt4 book ai didi

org.geotools.resources.XArray类的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 00:41:05 30 4
gpt4 key购买 nike

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

XArray介绍

[英]Simple operations on arrays. This class provides a central place for inserting and deleting elements in an array, as well as resizing the array. This class may be removed if JavaSoft provide some language construct functionally equivalent to C/C++'s realloc.
[中]对数组的简单操作。此类为插入和删除数组中的元素以及调整数组大小提供了一个中心位置。如果JavaSoft提供了一些功能等同于C/C++的realloc的语言构造,则可以删除此类。

代码示例

代码示例来源:origin: org.geotools/gt2-coverageio

/**
 * Libre la mmoire rserve en trop. Cette mthode peut tre appele
 * lorsqu'on a termin de lire les donnes et qu'on veut les conserver
 * en mmoire pendant encore quelque temps.
 */
public void trimToSize() {
  if (data != null) {
    data = XArray.resize(data, upper);
  }
}

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

/**
 * Inserts spaces into the middle of an array. These "spaces" will be made up of elements
 * initialized to zeros.
 *
 * @param array   Array in which to insert spaces.
 * @param index   Index where the first space should be inserted. All {@code array} elements
 *                having an index equal to or higher than {@code index} will be moved forward.
 * @param length  Number of spaces to insert.
 * @return        Array containing the {@code array} elements with the additional space
 *                inserted, or {@code array} if {@code length} is 0.
 */
public static byte[] insert(final byte[] array, final int index, final int length) {
  return doInsert(array, index, length);
}

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

/**
 * Removes elements from the middle of an array.
 *
 * @param array   Array from which to remove elements.
 * @param index   Index of the first element to remove from the given {@code array}.
 * @param length  Number of elements to remove.
 * @return        Array with the same elements than the given {@code array} except for the
 *                removed elements, or {@code array} if {@code length} is 0.
 */
public static double[] remove(final double[] array, final int index, final int length) {
  return doRemove(array, index, length);
}

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

/**
 * Returns an array containing the same elements as the given {@code array} but
 * specified {@code length}, truncating or padding with zeros if necessary.
 *
 * @param  array  Array to copy.
 * @param  length Length of the desired array.
 * @return A new array of the requested length, or {@code array} if the original
 *         array already have the requested length.
 */
public static int[] resize(final int[] array, final int length) {
  return doResize(array, length);
}

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

expectedTarget = expectedSource * scale + offset;
breakpoints[i][0] = sourceBreakpoints = XArray.resize(sourceBreakpoints, jbp);
breakpoints[i][1] = targetBreakpoints = XArray.resize(targetBreakpoints, jbp);
assert XArray.isSorted(sourceBreakpoints);

代码示例来源:origin: org.geotools/gt2-widgets-swing

/**
 * Set the foreground and background colors for messages of the specified level.
 * The specified colors will apply on any messages of level {@code level} or
 * greater, up to the next level set with an other call to {@code setLevelColor(...)}.
 *
 * @param level       The minimal level to set color for.
 * @param foreground  The foreground color, or {@code null} for the default color.
 * @param background  The background color, or {@code null} for the default color.
 */
public void setLevelColor(final Level level, final Color foreground, final Color background) {
  final int value = level.intValue();
  int i = Arrays.binarySearch(levelValues, value);
  if (i >= 0) {
    i *= 2;
    levelColors.set(i+0, foreground);
    levelColors.set(i+1, background);
  } else {
    i = ~i;
    levelValues = XArray.insert(levelValues, i, 1);
    levelValues[i] = value;
    i *= 2;
    levelColors.add(i+0, foreground);
    levelColors.add(i+1, background);
  }
  assert XArray.isSorted(levelValues);
  assert levelValues.length*2 == levelColors.size();
}

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

children = XArray.insert(children, i, 1);
children[i] = new Logging(logging, name);
logging.children = children;

代码示例来源:origin: org.geotools/gt2-coverage

/**
 * Removes an observer. If the observer was not registered, nothing happens.
 * If the observer was registered for multiple notifications, it will now be
 * registered for one fewer.
 */
public synchronized void removeTileObserver(final TileObserver observer) {
  if (observers != null) {
    for (int i=observers.length; --i>=0;) {
      if (observers[i] == observer) {
        observers = (TileObserver[]) XArray.remove(observers, i, 1);
        break;
      }
    }
  }
}

代码示例来源:origin: bcdev/beam

if (XArray.allEquals(background, 0)) {
  borderExtender = BorderExtender.createInstance(BorderExtender.BORDER_ZERO);
} else {

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

/**
 * Returns an array containing the same elements as the given {@code array} but
 * specified {@code length}, truncating or padding with zeros if necessary.
 *
 * @param  array  Array to copy.
 * @param  length Length of the desired array.
 * @return A new array of the requested length, or {@code array} if the original
 *         array already have the requested length.
 */
public static double[] resize(final double[] array, final int length) {
  return doResize(array, length);
}

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

children = (Logging[]) XArray.insert(children, i, 1);
children[i] = new Logging(logging, name);
logging.children = children;

代码示例来源:origin: org.geotools/gt2-widgets-swing

/**
 * Removes an editor from the list of those which display the
 * coordinates of the visor.
 *
 * @param editor Editor to remove.
 */
public synchronized void removeEditor(final JComponent editor) {
  if (editors != null) {
    for (int i = 0; i < editors.length; i++) {
      if (editors[i].editor == editor) {
        editors = (Control[])  XArray.remove(editors, i, 1);
        /*
         * In principal, there should be no more objects to 
         * remove from the table.  But we let the loop continue
         * anyway, just in case...
         */
      }
    }
    if (editors.length == 0) {
      editors = null;
    }
  }       
}

代码示例来源:origin: senbox-org/s2tbx

if (XArray.allEquals(background, 0)) {
  borderExtender = BorderExtender.createInstance(BorderExtender.BORDER_ZERO);
} else {

代码示例来源:origin: org.geotools/gt2-coverage

/**
 * Adds an observer. This observer will be notified everytime a tile initially empty become
 * available. If the observer is already present, it will receive multiple notifications.
 */
public synchronized void addTileObserver(final TileObserver observer) {
  if (observer != null) {
    if (observers == null) {
      observers = new TileObserver[] {observer};
    } else {
      final int length = observers.length;
      observers = (TileObserver[]) XArray.resize(observers, length+1);
      observers[length] = observer;
    }
  }
}

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

/**
 * Inserts spaces into the middle of an array. These "spaces" will be made up of elements
 * initialized to zeros.
 *
 * @param array   Array in which to insert spaces.
 * @param index   Index where the first space should be inserted. All {@code array} elements
 *                having an index equal to or higher than {@code index} will be moved forward.
 * @param length  Number of spaces to insert.
 * @return        Array containing the {@code array} elements with the additional space
 *                inserted, or {@code array} if {@code length} is 0.
 */
public static int[] insert(final int[] array, final int index, final int length) {
  return doInsert(array, index, length);
}

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

/**
 * Returns an array containing the same elements as the given {@code array} but
 * specified {@code length}, truncating or padding with zeros if necessary.
 *
 * @param  array  Array to copy.
 * @param  length Length of the desired array.
 * @return A new array of the requested length, or {@code array} if the original
 *         array already have the requested length.
 */
public static boolean[] resize(final boolean[] array, final int length) {
  return doResize(array, length);
}

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

/**
 * Removes elements from the middle of an array.
 *
 * @param array   Array from which to remove elements.
 * @param index   Index of the first element to remove from the given {@code array}.
 * @param length  Number of elements to remove.
 * @return        Array with the same elements than the given {@code array} except for the
 *                removed elements, or {@code array} if {@code length} is 0.
 */
public static int[] remove(final int[] array, final int index, final int length) {
  return doRemove(array, index, length);
}

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

changers = XArray.insert(changers, i, 1);
changers[i] = converter;

代码示例来源:origin: org.geotools/gt2-widgets-swing

/**
 * Makes sure that the {@link #visibles} array has the specified capacity.
 */
private void ensureCapacity(final int capacity) {
  if (visibles.length < capacity) {
    visibles = XArray.resize(visibles, Math.max(size*2, capacity));
  }
}

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

/**
 * Inserts spaces into the middle of an array. These "spaces" will be made up of elements
 * initialized to {@code false}.
 *
 * @param array   Array in which to insert spaces.
 * @param index   Index where the first space should be inserted. All {@code array} elements
 *                having an index equal to or higher than {@code index} will be moved forward.
 * @param length  Number of spaces to insert.
 * @return        Array containing the {@code array} elements with the additional space
 *                inserted, or {@code array} if {@code length} is 0.
 */
public static boolean[] insert(final boolean[] array, final int index, final int length) {
  return doInsert(array, index, length);
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com