com.ibm.security.certclient.util
Class PkArray
- java.lang.Object
-
- com.ibm.security.certclient.util.PkArray
-
public class PkArray extends Object
This is a utility class. It contains only static methods. All methods perform operations on arrays.- Author:
- Rod Mancisidor
-
-
Constructor Summary
Constructors Constructor and Description PkArray()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Object[]append(Object[] a1, Object[] a2)Return the result of appending two arraysstatic booleanareEqual(byte[] lhs, byte[] rhs)Return true if and only if the array lhs and the array rhs have the same length and:static booleanareEqual(Object[] lhs, Object[] rhs)Return true if and only if the array lhs and the array rhs have the same length and:static booleanisMember(Object member, Object[] array)Return true if and only if member equals any of the elements of arraystatic booleanisMember(Object member, Object[] array, Comparator<Object> comp)Return true if and only if member equals any of the elements of array using comp as the comparator objectstatic booleanisPrefix(byte[] lhs, byte[] rhs)Return true if and only if lhs.length <= rhs.length and:static Object[]slice(Object[] array, int from, int to)Return the slice of an array.
-
-
-
Method Detail
-
slice
public static Object[] slice(Object[] array, int from, int to)
Return the slice of an array. A slice is an array that contains a shallow copy of the elements of another array and may be truncated at the beginning or end.- Parameters:
array- the array to slicefrom- the index of the first element of array that is placed in the slice. If negative, then start to count from the endto- the index of the first element of array that is not placed in the slice. If negative, then start to count from the end- Returns:
- the slice
- Throws:
IllegalArgumentException- if to or from fall outside the array
-
append
public static Object[] append(Object[] a1, Object[] a2)
Return the result of appending two arrays
-
isMember
public static boolean isMember(Object member, Object[] array)
Return true if and only if member equals any of the elements of array
-
isMember
public static boolean isMember(Object member, Object[] array, Comparator<Object> comp)
Return true if and only if member equals any of the elements of array using comp as the comparator object
-
areEqual
public static boolean areEqual(Object[] lhs, Object[] rhs)
Return true if and only if the array lhs and the array rhs have the same length and:for all i in 0..lhs.length, lhs[i].equals(rhs[i])
-
areEqual
public static boolean areEqual(byte[] lhs, byte[] rhs)Return true if and only if the array lhs and the array rhs have the same length and:for all i in 0..lhs.length, lhs[i] == rhs[i]
-
isPrefix
public static boolean isPrefix(byte[] lhs, byte[] rhs)Return true if and only if lhs.length <= rhs.length and:for all i in 0..lhs.length, lhs[i] == rhs[i]
-
-