MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.util
Class Utils

java.lang.Object
  extended by ch.ethz.mxquery.util.Utils

public class Utils
extends java.lang.Object


Constructor Summary
Utils()
           
 
Method Summary
static java.util.Vector addToVector(java.util.Vector from, java.util.Vector to)
          Add the contents of one vector to the second - needed for CLDC
static int compareComparator(int i1, int i2)
          This method is for helping to retain the order of comparators and compareTypes
static java.lang.String expandCharRefs(java.lang.String res)
           
static java.util.Vector getCombinations(java.util.Vector combinations, java.util.Vector cur, java.util.Vector vectors, int len)
          Get the cartesian product of values
static java.lang.String getEncodedCharacter(char c)
          For character encoding in URL/URI/IRI
static java.lang.String getSimpleClassName(java.lang.String name)
           
static boolean isLetter(char ch)
           
static boolean isLowerCase(java.lang.String text)
           
static boolean isUpperCase(java.lang.String text)
           
static boolean isUpperCaseLetter(int chr)
           
static boolean isWhiteSpace(char cToCheck)
           
static java.lang.String normalizeString(java.lang.String res)
          Implementation of F&O normalize-string function - remove whitespace at beginning and end + reduce whitespace in the middle to one
static java.lang.String normalizeStringContent(java.lang.String res, boolean isIdAttr)
          Implementation of normalization in attributes and element content - remove whitespace at beginning and end + reduce whitespace in the middle to one, but only translate xD,x9 etc.
static java.lang.String readString(java.io.InputStream is)
           
static java.lang.String replaceAll(java.lang.String original, java.lang.String oldExpr, java.lang.String replacement)
           
static boolean sameCase(java.lang.String text, java.lang.String text2)
           
static java.lang.String[] split(java.lang.String source, java.lang.String delimeter)
          Splits a string into an array of Strings
static java.lang.String[] split(java.lang.String source, java.lang.String[] delimiters)
          Splits a string into an array of Strings
static java.lang.String stripLeadingWhitespace(java.lang.String val)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getSimpleClassName

public static java.lang.String getSimpleClassName(java.lang.String name)
Parameters:
name - - full class name
Returns:
- class name without package name

split

public static java.lang.String[] split(java.lang.String source,
                                       java.lang.String delimeter)
Splits a string into an array of Strings

Parameters:
source - The source string
delimeter - The delimeter String, that seperates the parts of the sequence
Returns:
An array of all elements of the splitted sequence

readString

public static java.lang.String readString(java.io.InputStream is)

split

public static java.lang.String[] split(java.lang.String source,
                                       java.lang.String[] delimiters)
Splits a string into an array of Strings

Parameters:
source - The source string
delimiters - The delimiters, that seperate the parts of the sequence
Returns:
An array of all elements of the splitted sequence

replaceAll

public static java.lang.String replaceAll(java.lang.String original,
                                          java.lang.String oldExpr,
                                          java.lang.String replacement)

expandCharRefs

public static java.lang.String expandCharRefs(java.lang.String res)

normalizeStringContent

public static java.lang.String normalizeStringContent(java.lang.String res,
                                                      boolean isIdAttr)
Implementation of normalization in attributes and element content - remove whitespace at beginning and end + reduce whitespace in the middle to one, but only translate xD,x9 etc.

Parameters:
res - String to be normalized
Returns:
the normalized String

normalizeString

public static java.lang.String normalizeString(java.lang.String res)
Implementation of F&O normalize-string function - remove whitespace at beginning and end + reduce whitespace in the middle to one

Parameters:
res - String to be normalized
Returns:
the normalized string

isWhiteSpace

public static boolean isWhiteSpace(char cToCheck)

isLetter

public static final boolean isLetter(char ch)

isLowerCase

public static boolean isLowerCase(java.lang.String text)

isUpperCase

public static boolean isUpperCase(java.lang.String text)

isUpperCaseLetter

public static boolean isUpperCaseLetter(int chr)

sameCase

public static boolean sameCase(java.lang.String text,
                               java.lang.String text2)

stripLeadingWhitespace

public static java.lang.String stripLeadingWhitespace(java.lang.String val)

getEncodedCharacter

public static java.lang.String getEncodedCharacter(char c)
For character encoding in URL/URI/IRI


compareComparator

public static int compareComparator(int i1,
                                    int i2)
This method is for helping to retain the order of comparators and compareTypes

Parameters:
i1 -
i2 -
Returns:
the order relationship: 0 equals, -1 if i1i2

getCombinations

public static java.util.Vector getCombinations(java.util.Vector combinations,
                                               java.util.Vector cur,
                                               java.util.Vector vectors,
                                               int len)
Get the cartesian product of values

Parameters:
combinations - Helper Vector, usually empty at top-level invocation
cur - Helper Vector, usually empty at top-level invocation
vectors - Items that should be combined
len - Length of items to look at
Returns:
the certesian product of vectors with length of len

addToVector

public static java.util.Vector addToVector(java.util.Vector from,
                                           java.util.Vector to)
                                    throws MXQueryException
Add the contents of one vector to the second - needed for CLDC

Parameters:
from -
to -
Returns:
the combination of the contents of both vectors
Throws:
MXQueryException

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich