org.apache.lucene.util
public final class ArrayUtil extends java.lang.Object
Constructor and Description |
---|
ArrayUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
getNextSize(int targetSize) |
static int |
getShrinkSize(int currentSize,
int targetSize) |
static byte[] |
grow(byte[] array) |
static byte[] |
grow(byte[] array,
int minSize) |
static int[] |
grow(int[] array) |
static int[] |
grow(int[] array,
int minSize) |
static long[] |
grow(long[] array) |
static long[] |
grow(long[] array,
int minSize) |
static int |
hashCode(byte[] array,
int start,
int end)
Returns hash of chars in range start (inclusive) to
end (inclusive)
|
static int |
hashCode(char[] array,
int start,
int end)
Returns hash of chars in range start (inclusive) to
end (inclusive)
|
static int |
parseInt(char[] chars)
Parses the string argument as if it was an int value and returns the
result.
|
static int |
parseInt(char[] chars,
int offset,
int len)
Parses a char array into an int.
|
static int |
parseInt(char[] chars,
int offset,
int len,
int radix)
Parses the string argument as if it was an int value and returns the
result.
|
static byte[] |
shrink(byte[] array,
int targetSize) |
static int[] |
shrink(int[] array,
int targetSize) |
static long[] |
shrink(long[] array,
int targetSize) |
public static int parseInt(char[] chars) throws java.lang.NumberFormatException
chars
- a string representation of an int quantity.java.lang.NumberFormatException
- if the argument could not be parsed as an int quantity.public static int parseInt(char[] chars, int offset, int len) throws java.lang.NumberFormatException
chars
- the character arrayoffset
- The offset into the arraylen
- The lengthjava.lang.NumberFormatException
- if it can't parsepublic static int parseInt(char[] chars, int offset, int len, int radix) throws java.lang.NumberFormatException
chars
- a string representation of an int quantity.radix
- the base to use for conversion.java.lang.NumberFormatException
- if the argument could not be parsed as an int quantity.public static int getNextSize(int targetSize)
public static int getShrinkSize(int currentSize, int targetSize)
public static int[] grow(int[] array, int minSize)
public static int[] grow(int[] array)
public static int[] shrink(int[] array, int targetSize)
public static long[] grow(long[] array, int minSize)
public static long[] grow(long[] array)
public static long[] shrink(long[] array, int targetSize)
public static byte[] grow(byte[] array, int minSize)
public static byte[] grow(byte[] array)
public static byte[] shrink(byte[] array, int targetSize)
public static int hashCode(char[] array, int start, int end)
public static int hashCode(byte[] array, int start, int end)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.