org.sblim.cimclient.internal.util

Class StringSorter

public class StringSorter extends Object implements Comparator

Class StringSorter is responsible for non case sensitive sorting and binary searching of String arrays.
Method Summary
intcompare(Object pO1, Object pO2)
static booleanfind(String[] pArray, String pName)
Finds pName, in pArray which must be a non case sensitive sorted array of Strings.
static String[]sort(String[] pArray)
Sorts non case sensitively the passed String array, the passed array is not copied.

Method Detail

compare

public int compare(Object pO1, Object pO2)

See Also: java.util.Comparator#compare(java.lang.Object, java.lang.Object)

find

public static boolean find(String[] pArray, String pName)
Finds pName, in pArray which must be a non case sensitive sorted array of Strings.

Parameters: pArray pName

Returns: true if found, otherwise false

sort

public static String[] sort(String[] pArray)
Sorts non case sensitively the passed String array, the passed array is not copied.

Parameters: pArray the array which will be sorted if it's not null

Returns: pArray

Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.