gpt4 book ai didi

org.geotools.resources.XArray.doResize()方法的使用及代码示例

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

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

XArray.doResize介绍

[英]Returns a new table which contains the same elements as array but with the length specified. If the desired length is longer than the initial length of the array table, the returned table will contain all the elements of array as well as the elements initialised to null at the end of the table. If, on the contrary, the desired length is shorter than the initial length of the array table, the table will be truncated (that is to say the surplus array elements will be forgotten). If the length of array is equal to length, then array will be returned as it stands.
[中]返回一个新表,该表包含与数组相同的元素,但具有指定的长度。如果所需的长度大于数组表的初始长度,则返回的表将包含数组的所有元素以及在表末尾初始化为null的元素。相反,如果所需的长度小于数组表的初始长度,则该表将被截断(也就是说,多余的数组元素将被忽略)。如果数组的长度等于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-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/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

/**
 * 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 byte[] resize(final byte[] array, final int length) {
  return doResize(array, 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 float[] resize(final float[] array, final int length) {
  return doResize(array, 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 long[] resize(final long[] array, final int length) {
  return doResize(array, 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 short[] resize(final short[] array, final int length) {
  return doResize(array, 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 char[] resize(final char[] array, final int length) {
  return doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static short[] resize(final short[] array, final int length) {
  return (short[]) doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static double[] resize(final double[] array, final int length) {
  return (double[]) doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static float[] resize(final float[] array, final int length) {
  return (float[]) doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static char[] resize(final char[] array, final int length) {
  return (char[]) doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static Object[] resize(final Object[] array, final int length) {
  return (Object[]) doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static long[] resize(final long[] array, final int length) {
  return (long[]) doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static int[] resize(final int[] array, final int length) {
  return (int[]) doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static byte[] resize(final byte[] array, final int length) {
  return (byte[]) doResize(array, length);
}

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

/**
 * Returns a new table which contains the same elements as
 * {@code array} but with the {@code length} specified.
 * If the desired {@code length} is longer than the initial
 * length of the {@code array} table, the returned table will contain
 * all the elements of {@code array} as well as the elements
 * initialised to {@code null} at the end of the table. If, on the
 * contrary, the desired {@code length} is shorter than the initial
 * length of the {@code array} table, the table will be truncated
 * (that is to say the surplus {@code array} elements will be
 * forgotten). If the length of {@code array} is equal to
 * {@code length}, then {@code array} will be returned as it
 * stands.
 *
 * @param  array Table to copy.
 * @param  length Length of the desired table.
 * @return Table of the same type as {@code array}, of length
 *         {@code length} and containing the data from
 *         {@code array}.
 */
public static boolean[] resize(final boolean[] array, final int length) {
  return (boolean[]) doResize(array, length);
}

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

/**
 * Returns an array containing the same elements as the given {@code array} but with the
 * specified {@code length}, truncating or padding with {@code null} if necessary.
 * <ul>
 *   <li><p>If the given {@code length} is longer than the length of the given {@code array},
 *       then the returned array will contain all the elements of {@code array} at index
 *       <var>i</var> &lt; {@code array.length}. Elements at index <var>i</var> &gt;=
 *       {@code array.length} are initialized to {@code null}.</p></li>
 *
 *   <li><p>If the given {@code length} is shorter than the length of the given {@code array},
 *       then the returned array will contain only the elements of {@code array} at index
 *       <var>i</var> &lt; {@code length}. Remainding elements are not copied.</p></li>
 *
 *   <li><p>If the given {@code length} is equals to the length of the given {@code array},
 *       then {@code array} is returned unchanged. <strong>No copy</strong> is performed.
 *       This behavior is what make this method different than {@link Arrays#copyOf}.</p></li>
 *
 * @param  <E> The array elements.
 * @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.
 *
 * @see Arrays#copyOf(Object[],int)
 */
public static <E> E[] resize(final E[] array, final int length) {
  return doResize(array, length);
}

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