org.sblim.cimclient.internal.util
Class StringSorter

java.lang.Object
  extended by org.sblim.cimclient.internal.util.StringSorter
All Implemented Interfaces:
Comparator<Object>

public class StringSorter
extends Object
implements Comparator<Object>

Class StringSorter is responsible for non case sensitive sorting and binary searching of String arrays.


Constructor Summary
StringSorter()
           
 
Method Summary
 int compare(Object pO1, Object pO2)
           
static boolean find(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

StringSorter

public StringSorter()
Method Detail

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

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

compare

public int compare(Object pO1,
                   Object pO2)
Specified by:
compare in interface Comparator<Object>
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)


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