Package com.ctc.wstx.util
Class DataUtil
java.lang.Object
com.ctc.wstx.util.DataUtil
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
anyValuesInCommon
(Collection<T> c1, Collection<T> c2) Method that can be used to efficiently check if 2 collections share at least one common element.static <T> Iterator
<T> static char[]
static int[]
growArrayBy
(int[] arr, int more) static String[]
growArrayBy
(String[] arr, int more) static Object
growArrayBy50Pct
(Object arr) static Object
growArrayToAtLeast
(Object arr, int minLen) Method similar togrowArrayBy50Pct(java.lang.Object)
, but it also ensures that the new size is at least as big as the specified minimum size.static Object
growArrayToAtMost
(Object arr, int maxLen) Method similar togrowArrayBy50Pct(java.lang.Object)
, but it also ensures that the new size is no bigger than specific maximum size.static Integer
Integer
(int i) static <T> Iterator
<T> singletonIterator
(T item)
-
Field Details
-
EMPTY_CHAR_ARRAY
static final char[] EMPTY_CHAR_ARRAY -
MAX_LONG
-
NO_TYPE
- See Also:
-
-
Constructor Details
-
DataUtil
private DataUtil()
-
-
Method Details
-
getEmptyCharArray
public static char[] getEmptyCharArray() -
Integer
-
singletonIterator
-
emptyIterator
-
anyValuesInCommon
Method that can be used to efficiently check if 2 collections share at least one common element.- Returns:
- True if there is at least one element that's common to both Collections, ie. that is contained in both of them.
-
growArrayBy50Pct
-
growArrayToAtLeast
Method similar togrowArrayBy50Pct(java.lang.Object)
, but it also ensures that the new size is at least as big as the specified minimum size. -
growArrayToAtMost
Method similar togrowArrayBy50Pct(java.lang.Object)
, but it also ensures that the new size is no bigger than specific maximum size. -
growArrayBy
-
growArrayBy
public static int[] growArrayBy(int[] arr, int more)
-