org.teiid.internal.core.index
Class Util

java.lang.Object
  extended by org.teiid.internal.core.index.Util

public class Util
extends java.lang.Object


Method Summary
static int compare(char[] str1, char[] str2)
          Compares two strings lexicographically.
static int prefixLength(char[] s1, char[] s2)
          Returns the length of the common prefix between s1 and s2.
static int prefixLength(java.lang.String s1, java.lang.String s2)
          Returns the length of the common prefix between s1 and s2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compare

public static int compare(char[] str1,
                          char[] str2)
Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings.

Returns:
the value 0 if the str1 is equal to str2; a value less than 0 if str1 is lexicographically less than str2; and a value greater than 0 if str1 is lexicographically greater than str2.

prefixLength

public static int prefixLength(char[] s1,
                               char[] s2)
Returns the length of the common prefix between s1 and s2.


prefixLength

public static int prefixLength(java.lang.String s1,
                               java.lang.String s2)
Returns the length of the common prefix between s1 and s2.



Copyright © 2011. All Rights Reserved.