Package com.ctc.wstx.util
Class DataUtil
- java.lang.Object
-
- com.ctc.wstx.util.DataUtil
-
public final class DataUtil extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DataUtil.EI
-
Field Summary
Fields Modifier and Type Field Description (package private) static char[]
EMPTY_CHAR_ARRAY
(package private) static java.lang.Long
MAX_LONG
(package private) static java.lang.String
NO_TYPE
-
Constructor Summary
Constructors Modifier Constructor Description private
DataUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> boolean
anyValuesInCommon(java.util.Collection<T> c1, java.util.Collection<T> c2)
Method that can be used to efficiently check if 2 collections share at least one common element.static <T> java.util.Iterator<T>
emptyIterator()
static char[]
getEmptyCharArray()
static int[]
growArrayBy(int[] arr, int more)
static java.lang.String[]
growArrayBy(java.lang.String[] arr, int more)
static java.lang.Object
growArrayBy50Pct(java.lang.Object arr)
static java.lang.Object
growArrayToAtLeast(java.lang.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 java.lang.Object
growArrayToAtMost(java.lang.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 java.lang.Integer
Integer(int i)
static <T> java.util.Iterator<T>
singletonIterator(T item)
-
-
-
Field Detail
-
EMPTY_CHAR_ARRAY
static final char[] EMPTY_CHAR_ARRAY
-
MAX_LONG
static final java.lang.Long MAX_LONG
-
NO_TYPE
static final java.lang.String NO_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEmptyCharArray
public static char[] getEmptyCharArray()
-
Integer
public static java.lang.Integer Integer(int i)
-
singletonIterator
public static <T> java.util.Iterator<T> singletonIterator(T item)
-
emptyIterator
public static <T> java.util.Iterator<T> emptyIterator()
-
anyValuesInCommon
public static <T> boolean anyValuesInCommon(java.util.Collection<T> c1, java.util.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.
-
growArrayBy50Pct
public static java.lang.Object growArrayBy50Pct(java.lang.Object arr)
-
growArrayToAtLeast
public static java.lang.Object growArrayToAtLeast(java.lang.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 java.lang.Object growArrayToAtMost(java.lang.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 java.lang.String[] growArrayBy(java.lang.String[] arr, int more)
-
growArrayBy
public static int[] growArrayBy(int[] arr, int more)
-
-