com.ibm.security.certclient.util

Class PkArray

  1. java.lang.Object
  2. extended bycom.ibm.security.certclient.util.PkArray

  1. public class PkArray
  2. extends Object
This is a utility class. It contains only static methods. All methods perform operations on arrays.
Author:
Rod Mancisidor

Constructor Summary

Constructor and Description
PkArray()

Method Summary

Modifier and Type Method and Description
  1. static
  2. Object[]
append(Object[] a1,Object[] a2)
Return the result of appending two arrays
  1. static
  2. boolean
areEqual(byte[] lhs,byte[] rhs)
Return true if and only if the array lhs and the array rhs have the same length and:
  1. static
  2. boolean
areEqual(Object[] lhs,Object[] rhs)
Return true if and only if the array lhs and the array rhs have the same length and:
  1. static
  2. boolean
isMember(Object member,Object[] array)
Return true if and only if member equals any of the elements of array
  1. static
  2. boolean
isMember(Object member,Object[] array,Comparator comp)
Return true if and only if member equals any of the elements of array using comp as the comparator object
  1. static
  2. boolean
isPrefix(byte[] lhs,byte[] rhs)
Return true if and only if lhs.length <= rhs.length and:
  1. static
  2. Object[]
slice(Object[] array,int from,int to)
Return the slice of an array.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PkArray

  1. public PkArray()

Method Detail

slice

  1. public static Object[] slice(Object[] array,
  2. int from,
  3. 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 slice
from - the index of the first element of array that is placed in the slice. If negative, then start to count from the end
to - 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

  1. public static Object[] append(Object[] a1,
  2. Object[] a2)
Return the result of appending two arrays

isMember

  1. public static boolean isMember( Object member,
  2. Object[] array)
Return true if and only if member equals any of the elements of array

isMember

  1. public static boolean isMember( Object member,
  2. Object[] array,
  3. Comparator comp)
Return true if and only if member equals any of the elements of array using comp as the comparator object

areEqual

  1. public static boolean areEqual( Object[] lhs,
  2. 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

  1. public static boolean areEqual( byte[] lhs,
  2. 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

  1. public static boolean isPrefix( byte[] lhs,
  2. byte[] rhs)
Return true if and only if lhs.length <= rhs.lengthand:

for all i in 0..lhs.length, lhs[i] == rhs[i]