Package com.ctc.wstx.util
Class DataUtil
- java.lang.Object
-
- com.ctc.wstx.util.DataUtil
-
public final class DataUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> booleananyValuesInCommon(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>emptyIterator()static char[]getEmptyCharArray()static int[]growArrayBy(int[] arr, int more)static String[]growArrayBy(String[] arr, int more)static ObjectgrowArrayBy50Pct(Object arr)static ObjectgrowArrayToAtLeast(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 ObjectgrowArrayToAtMost(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 IntegerInteger(int i)static <T> Iterator<T>singletonIterator(T item)
-
-
-
Method Detail
-
getEmptyCharArray
public static char[] getEmptyCharArray()
-
Integer
public static Integer Integer(int i)
-
singletonIterator
public static <T> Iterator<T> singletonIterator(T item)
-
emptyIterator
public static <T> Iterator<T> emptyIterator()
-
anyValuesInCommon
public static <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.- Returns:
- True if there is at least one element that's common to both Collections, ie. that is contained in both of them.
-
growArrayToAtLeast
public 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.
-
growArrayToAtMost
public 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.
-
growArrayBy
public static int[] growArrayBy(int[] arr, int more)
-
-